Documentation ¶
Index ¶
- Constants
- Variables
- func NewMongoStorage(c MongoDBConfig) (currencyFetcher.Storage, error)
- func NewMySQLStorage(c MySQLConfig) (currencyFetcher.Storage, error)
- func NewStorage(provider Provider, config interface{}) (currencyFetcher.Storage, error)
- type BaseConfig
- type IDGenerator
- type MongoDBConfig
- type MySQLConfig
- type Provider
Constants ¶
View Source
const ( MySQLStorageProviderName = "mysql" MySQLTimeFormat = "2006-01-02 15:04:05" )
View Source
const MongoDBProviderName = "mongodb"
Variables ¶
View Source
var ErrNotEnoughBytesInGenerator = errors.New("id generator must return byte slice with 16 bytes in it")
View Source
var (
ErrStorageNotFound = errors.New("storage is not found")
)
Functions ¶
func NewMongoStorage ¶
func NewMongoStorage(c MongoDBConfig) (currencyFetcher.Storage, error)
func NewMySQLStorage ¶
func NewMySQLStorage(c MySQLConfig) (currencyFetcher.Storage, error)
func NewStorage ¶
func NewStorage(provider Provider, config interface{}) (currencyFetcher.Storage, error)
Types ¶
type BaseConfig ¶
type IDGenerator ¶
type IDGenerator interface {
Generate() []byte
}
type MongoDBConfig ¶
type MongoDBConfig struct { BaseConfig ConnectionString string Database string Collection string }
type MySQLConfig ¶
type MySQLConfig struct { BaseConfig ConnectionString string TableName string IDGenerator IDGenerator }
type Provider ¶
type Provider string
Click to show internal directories.
Click to hide internal directories.