Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomDay ¶
CustomDay is a date time object in the cdLayout format
func (*CustomDay) UnmarshalJSON ¶
UnmarshalJSON parses a string in the cdLayout
type CustomTime ¶
CustomTime is a date time object in the ctLayout format
func (*CustomTime) UnmarshalJSON ¶
func (ct *CustomTime) UnmarshalJSON(input []byte) error
UnmarshalJSON parses a string in the ctLayout
type DefaultConfig ¶
type DefaultConfig struct { Exchanges []string `json:"exchanges"` IndexGroups []string `json:"index_groups"` UpdateTime time.Time `json:"update_time"` Timeframe string `json:"timeframe"` APIToken string `json:"token"` Timeout int `json:"timeout"` OpenTime time.Time CloseTime time.Time ClosedDaysOfTheWeek []time.Weekday ClosedDays []time.Time Interval int `json:"interval"` // If a non-zero value is set for OffHoursInterval, // the data-feeding is executed every offHoursInterval[minute] even when the market is closed. OffHoursInterval int `json:"off_hours_interval"` Backfill struct { Enabled bool `json:"enabled"` Since CustomDay `json:"since"` Timeframe string `json:"timeframe"` } `json:"backfill"` // for the past X market-open days, // Xignite Feeder can feed 5-minute chart data for the target symbols in addition to daily-chart data backfill. RecentBackfill struct { Enabled bool `json:"enabled"` Days int `json:"days"` Timeframe string `json:"timeframe"` } `json:"recentBackfill"` }
DefaultConfig is the configuration for XigniteFeeder you can define in marketstore's config file through bgworker extension.
func NewConfig ¶
func NewConfig(config map[string]interface{}) (*DefaultConfig, error)
NewConfig casts a map object to Config struct and returns it through json marshal->unmarshal
func (*DefaultConfig) UnmarshalJSON ¶
func (c *DefaultConfig) UnmarshalJSON(input []byte) error
UnmarshalJSON parses the config data to the DefaultConfig object. Because some parameters (OpenTime, ClosedDaysOfTheWeek, etc) have their original types and unmarshal methods but it's troublesome for other business logic to use those not-general types, so this method parses the data to an auxiliary struct and cast the types first, then parse to the DefaultConfig object.