Documentation
¶
Index ¶
- func NewHTTPIDMapper(log *logrus.Logger, url string, timeout time.Duration) (*idmapper.IDMapper, error)
- func NewPgSQLIDMapper(log *logrus.Logger, db *sql.DB, query string) (*idmapper.IDMapper, error)
- func NewRedisIDMapper(client *redis.Client, hashName string) (*idmapper.IDMapper, error)
- type Config
- type IDMappers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPIDMapper ¶
func NewHTTPIDMapper(log *logrus.Logger, url string, timeout time.Duration) (*idmapper.IDMapper, error)
NewHTTPIDMapper creates IDMapper that reads data from http
func NewPgSQLIDMapper ¶
NewPgSQLIDMapper creates IDMapper that reads data from sql database
Types ¶
type Config ¶
type Config struct { Reloader struct { Currency struct { Interval time.Duration `mapstructure:"interval"` RedisHashName string `mapstructure:"redis_hash_name"` } `mapstructure:"currency"` Country struct { Interval time.Duration `mapstructure:"interval"` } `mapstructure:"country"` Language struct { Interval time.Duration `mapstructure:"interval"` } `mapstructure:"language"` } `mapstructure:"reloader"` Loader struct { Timeout time.Duration `mapstructure:"timeout"` URLs struct { Currency string `mapstructure:"currency"` Country string `mapstructure:"country"` Language string `mapstructure:"language"` } `mapstructure:"urls"` } `mapstructure:"loader"` }
Config configuration of IDMappers
type IDMappers ¶
type IDMappers struct { CurrencyCodes *idmapper.IDMapper CountryCodes *idmapper.IDMapper LanguageCodes *idmapper.IDMapper // contains filtered or unexported fields }
IDMappers consists of available IDMapper objects
func NewIDMappers ¶
func NewIDMappers(log *logrus.Logger, client *redis.Client, db *sql.DB, config *Config) (*IDMappers, error)
NewIDMappers creates IDMappers with available IDMapper objects
func (*IDMappers) RunReloader ¶
RunReloader starts scheduler for automatic reloading of IDMapper objects
func (*IDMappers) StopReloader ¶
func (idMappers *IDMappers) StopReloader()
StopReloader stops scheduler for automatic reloading of IDMapper objects
Click to show internal directories.
Click to hide internal directories.