Documentation ¶
Index ¶
- Constants
- func GetRestyClient() *restyClient
- func NewRestyClient(defaultTimeout *time.Duration, defaultRetryCount *int) *restyClient
- func NewSingleton[T any](initFunc func() (T, error)) *singleton[T]
- func PrimeNumberHasher(stringVal string) *big.Int
- type ItemPriceSplit
- type ItemPriceSplits
- type PostPriceArmsResponse
- type PostSpressoEventRequest
- type PriceOptimizationReport
- type PriceOptimizationReportInfo
- type PriceOptimizationReportProperties
- type RestyClient
- type RestyRequest
- type Singleton
- type SingletonInitFunc
- type SpressoEvent
Constants ¶
View Source
const (
SpressoPriceOptimizationEvent = "spresso_price_optimization_request"
)
Variables ¶
This section is empty.
Functions ¶
func GetRestyClient ¶ added in v0.5.0
func GetRestyClient() *restyClient
func NewRestyClient ¶
func NewSingleton ¶ added in v0.5.0
func PrimeNumberHasher ¶ added in v0.5.0
s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
Types ¶
type ItemPriceSplit ¶ added in v0.5.0
type ItemPriceSplits ¶ added in v0.5.0
type ItemPriceSplits struct { Sku string `json:"sku" msgpack:"sku"` PriceSplits []ItemPriceSplit `json:"priceSplits" msgpack:"priceSplits"` ReportInfo PriceOptimizationReportInfo `json:"reportInfo" msgpack:"reportInfo"` ExpiresAt int64 `json:"expiresAt" msgpack:"expiresAt"` }
type PostPriceArmsResponse ¶ added in v0.5.0
type PostPriceArmsResponse struct {
Data []*ItemPriceSplits `json:"data"`
}
type PostSpressoEventRequest ¶ added in v0.5.0
type PostSpressoEventRequest struct {
Datas []SpressoEvent `json:"datas"`
}
type PriceOptimizationReport ¶ added in v0.5.0
type PriceOptimizationReport struct { Sku string `json:"sku"` Price float64 `json:"price"` DefaultPrice float64 `json:"defaultPrice"` OverrideToDefaultPrice bool `json:"overrideToDefaultPrice"` VariantId string `json:"variantId"` StandardPrice float64 `json:"standardPrice"` Cost float64 `json:"cost"` ProfitWeight float64 `json:"profitWeight"` IsPriceOptimized bool `json:"isPriceOptimized"` IsHoldout bool `json:"isHoldOut"` HasVariant bool `json:"hasVariant"` HasPriceOptimizationConfig bool `json:"hasPriceOptimizationConfig"` IsAutoGenerated bool `json:"isAutoGenerated"` CampaignId string `json:"campaignId"` }
type PriceOptimizationReportInfo ¶ added in v0.5.0
type PriceOptimizationReportInfo struct { VariantId string `json:"variantId" msgpack:"variantId"` StandardPrice float64 `json:"standardPrice" msgpack:"standardPrice"` Cost float64 `json:"cost" msgpack:"cost"` ProfitWeight float64 `json:"profitWeight" msgpack:"profitWeight"` HasVariant bool `json:"hasVariant" msgpack:"hasVariant"` HasPriceOptimizationConfig bool `json:"hasPriceOptimizationConfig" msgpack:"hasPriceOptimizationConfig"` IsAutoGenerated bool `json:"isAutoGenerated" msgpack:"isAutoGenerated"` CampaignId string `json:"campaignId" msgpack:"campaignId"` }
type PriceOptimizationReportProperties ¶ added in v0.5.0
type PriceOptimizationReportProperties struct { DeviceId string `json:"deviceId"` UserId *string `json:"userId"` Report PriceOptimizationReport `json:"report"` }
type RestyClient ¶
type RestyClient interface {
R(ctx context.Context, host string) RestyRequest
}
type RestyRequest ¶
type RestyRequest interface { SetHeader(header, value string) RestyRequest SetHeaderMultiValues(headers map[string][]string) RestyRequest SetQueryParam(param, value string) RestyRequest SetQueryParams(params map[string]string) RestyRequest SetBody(body interface{}) RestyRequest SetResult(res interface{}) RestyRequest SetPathParam(params, value string) RestyRequest SetPathParams(params map[string]string) RestyRequest SetRetryCount(retryCount int) RestyRequest SetTimeout(timeout time.Duration) RestyRequest SetSuccessCode(successCode int) RestyRequest Get(endpoint string) (*resty.Response, error) Post(endpoint string) (*resty.Response, error) Put(endpoint string) (*resty.Response, error) }
type SingletonInitFunc ¶ added in v0.5.0
type SpressoEvent ¶ added in v0.5.0
type SpressoEvent struct { Event string `json:"event"` Uid string `json:"uid"` UtcTimestampMs int64 `json:"utcTimestampMs"` TimezoneOffset int `json:"timezoneOffset"` Properties PriceOptimizationReportProperties `json:"properties"` }
Click to show internal directories.
Click to hide internal directories.