Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrProductJsonNotValid = fmt.Errorf("emitted product JSON is not valid")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Environment string `json:"environment"` IsProductionMode bool `json:"isProductionMode"` AwsRegion string `json:"awsRegion"` DSN string `json:"dsn"` Queues *QueuesConfig `json:"queues"` SyncFrequency time.Duration `json:"syncFrequency"` DatadogConfig *DatadogConfig `json:"datadog"` }
type DatabaseService ¶
type DatabaseService interface { GetProductByReferece(id string) (*XdProduct, error) GetProductsByReferece(ids []string) (*XdProducts, error) GetPricedProductsCount(ts *time.Time) (int, error) GetPaginatedPricedProducts(ts *time.Time, limit int, offset int) (*XdProducts, error) GetPricedProducts() (*XdProducts, error) GetPricedProductsSinceTimestamp(ts *time.Time) (*XdProducts, error) }
type DatadogConfig ¶ added in v1.1.0
type MessagePublishInput ¶ added in v1.3.0
type QueuesConfig ¶
type QueuesConfig struct {
ProductUpdatesSnsQueueArn string `json:"productUpdatesSnsQueueArn,omitempty"`
}
type SNSService ¶
type SNSService interface { SendMessage(topicArn string, input *MessagePublishInput) error SendMessagesBatch(topicArn string, input *[]MessagePublishInput) (int, []error) }
type XdProduct ¶
type XdProduct struct { SKU string `db:"KeyId" dbSelector:"i.KeyId" json:"sku"` Description string `db:"Description" dbSelector:"i.Description" json:"name"` RetailPrice1 float64 `db:"RetailPrice1" dbSelector:"i.RetailPrice1" json:"clientCompareAtPrice"` RetailPrice2 float64 `db:"RetailPrice2" dbSelector:"i.RetailPrice2" json:"clientPrice"` AvailableQuantity float64 `db:"AvailableQuantity" dbSelector:"IFNULL(istock.AvailableQuantity, 0) as AvailableQuantity" json:"availableQuantity"` SyncStamp *time.Time `db:"SyncStamp" dbSelector:"i.SyncStamp as SyncStamp" json:"syncStamp"` StockSyncStamp *time.Time `db:"StockSyncStamp" dbSelector:"istock.SyncStamp as StockSyncStamp" json:"stockSyncStamp"` StockLastEntrance *time.Time `db:"StockLastEntrance" dbSelector:"istock.LastEntrance as StockLastEntrance" json:"stockLastEntrance"` StockLastExit *time.Time `db:"StockLastExit" dbSelector:"istock.LastExit as StockLastExit" json:"stockLastExit"` }
func (*XdProduct) GetKnownColumns ¶
func (*XdProduct) GetKnownColumnsQuerySelectors ¶
func (*XdProduct) GetPrimaryKeyColumnName ¶
func (*XdProduct) GetTableName ¶
type XdProducts ¶
type XdProducts []XdProduct
func (*XdProducts) GetKnownColumnsQuerySelectors ¶
func (ps *XdProducts) GetKnownColumnsQuerySelectors() string
func (*XdProducts) GetPrimaryKeyColumnName ¶
func (ps *XdProducts) GetPrimaryKeyColumnName() string
func (*XdProducts) GetTableName ¶
func (ps *XdProducts) GetTableName() string
func (*XdProducts) ToJSON ¶
func (ps *XdProducts) ToJSON() (string, error)
type XdProductsChunksWithMutex ¶ added in v1.2.0
type XdProductsChunksWithMutex struct { Chunks *map[int]XdProducts // contains filtered or unexported fields }
func (*XdProductsChunksWithMutex) GetList ¶ added in v1.2.0
func (c *XdProductsChunksWithMutex) GetList(list *XdProducts)
func (*XdProductsChunksWithMutex) UpdateChunk ¶ added in v1.2.0
func (c *XdProductsChunksWithMutex) UpdateChunk(index int, productsList *XdProducts)
type XdRsyncInstance ¶
type XdRsyncInstance struct { Config *Config Logger *logger.Logger Services *XdRsyncServices }
type XdRsyncServices ¶
type XdRsyncServices struct { Database DatabaseService SNS SNSService }
Click to show internal directories.
Click to hide internal directories.