Skip to content

Latest commit

 

History

History
32 lines (26 loc) · 1.05 KB

README.md

File metadata and controls

32 lines (26 loc) · 1.05 KB

Storage

Go Report Card

import "github.com/golang-common-packages/storage"

Working with MongoDB:

dbConn = storage.New(storage.NOSQLDOCUMENT)(storage.MONGODB, &storage.Config{MongoDB: storage.MongoDB{
		User:     "USERNAME",
		Password: "PASSWORD",
		Hosts:    "STRING_URI_SLICE",
		Options:  "STRING_OPTION_SLICE",
		DB:       "DATABASE_NAME",
	}}).(storage.INoSQLDocument)

Working with Google Drive:

driveConn := storage.New(storage.FILE)(storage.DRIVE, &storage.Config{GoogleDrive: storage.GoogleDrive{
		PoolSize:     4,
		ByHTTPClient: false,
		Credential:   "credentials.json",
		Token:        "token.json",
	}}).(storage.IFILE)

Note

How to use this package?