Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { StorerArgs DbConnection LoaderArgs ConnArgs Log Logger }
func LoadConfig ¶
type ConnArgs ¶
type ConnArgs struct { Uri string `default:"http://bsm.api.iql.ru/ords/bsm/segmentation/get_segmentation"` AuthLoginPwd string `default:"4Dfddf5:jKlljHGH" split_words:"true"` UserAgent string `default:"spacecount-test" split_words:"true"` ConnectTimeout time.Duration `default:"5s" envconfig:"CONN_TIMEOUT"` Interval time.Duration `default:"1500ms"` ImportBatchSize int `default:"50" envconfig:"IMPORT_BATCH_SIZE"` }
type DbConnection ¶
type HTTPLoader ¶
type HTTPLoader struct {
// contains filtered or unexported fields
}
func NewHTTPLoader ¶
func NewHTTPLoader( log *log.Logger, args *ConnArgs) (*HTTPLoader, error)
func (*HTTPLoader) LoadNext ¶
func (hi *HTTPLoader) LoadNext() ([]model.Segmentation, error)
type Loader ¶
type Loader interface {
LoadNext() ([]model.Segmentation, error)
}
type Logger ¶
type Logger struct {
CleanupMaxAgeDays int `default:"7" envconfig:"LOG_CLEANUP_MAX_AGE"`
}
type PGStorer ¶
type PGStorer struct {
// contains filtered or unexported fields
}
func NewPGStorer ¶
func NewPGStorer(cfg *DbConnection) (*PGStorer, error)
type Storer ¶
type Storer interface {
Store(segs []model.Segmentation) error
}
Click to show internal directories.
Click to hide internal directories.