# README
Storage
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
# Functions
GetContext return the current context.
New database by abstract factory pattern.
SetContext set new context.
# Constants
BIGCACHE database.
CUSTOM caching on local memory.
CUSTOMFILE file services.
DRIVE cloud services.
FILE is file management.
MONGODB database.
NOSQLDOCUMENT is NoSQL document type.
NOSQLKEYVALUE is NoSQL key-value type.
REDIS database.
SQLLike database (common relational database).
SQLRELATIONAL is SQL relational type.
# Structs
BigCacheClient manage all BigCache actions.
Config model for database config.
CustomFile config model.
CustomFileClient manage all custom file action.
CustomKeyValue config model.
DriveServices manage all drive action.
GoogleDrive config model.
GoogleFileListModel for unmarshal object has interface type.
GoogleFileModel for unmarshal object has interface type.
KeyValueCustomClient manage all custom caching actions.
LIKE model for SQL-LIKE connection config.
MongoClient manage all mongodb actions.
MongoDB model for MongoDB connection config.
Redis model for redis config.
RedisClient manage all redis actions.
SQLLikeClient manage all SQL-Like actions.
# Interfaces
IFILE factory pattern interface.
INoSQLDocument factory pattern CRUD interface.
INoSQLKeyValue factory pattern interface.
ISQLRelational factory pattern interface.