config

package
v0.0.0-...-df03107 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2020 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigErrCode = 1001
)
View Source
const (
	ExchangeBitmex = "bitmex"
)

Variables

View Source
var ConfigErr = errcode.CreateCoinBaseError(
	ConfigErrCode, "Invalid config: %s")

Functions

This section is empty.

Types

type CoinCorpConfig

type CoinCorpConfig struct {
	TimeZone    string                     `toml:"time-zone" json:"time_zone"`
	Interval    []int                      `toml:"kline-interval" json:"kline_interval"`
	Http        *HttpConfig                `toml:"http" json:"http"`
	Websocket   *WebsocketConfig           `toml:"websocket" json:"websocket"`
	ExchangeMap map[string]*ExchangeConfig `toml:"exchange" json:"exchange"`

	BaseConfig *baseconfig.Config
}

func GetCoinCorpConfig

func GetCoinCorpConfig() *CoinCorpConfig

func LoadConfig

func LoadConfig(configPath string, basePath string) *CoinCorpConfig

func (*CoinCorpConfig) LoadFromToml

func (c *CoinCorpConfig) LoadFromToml(configFile string) error

type ExchangeConfig

type ExchangeConfig struct {
	WebsocketAddress string   `toml:"websocket-address" json:"websocket_address"`
	APIKey           string   `toml:"api-key" json:"api_key"`
	APISecret        string   `toml:"api-secret" json:"api_secret"`
	Symbols          []string `toml:"symbols" json:"symbols"`
	Topic            []string `toml:"topic" json:"topic"`
	HttpUrl          string   `toml:"http-url" json:"http_url"`
}

type HttpConfig

type HttpConfig struct {
	Proxy         string `toml:"proxy" json:"proxy"`
	Timeout       int    `toml:"timeout" json:"timeout"`
	RetryCount    int    `toml:"retry-count" json:"retry_count"`
	RetryInterval int    `toml:"retry-interval" json:"retry_interval"`
}

type WebsocketConfig

type WebsocketConfig struct {
	HeartbeatDuration int `toml:"heartbeat-duration" json:"heartbeat_duration"`
	WriteWait         int `toml:"write-wait" json:"write_wait"`
	ReadWait          int `toml:"read-wait" json:"read_wait"`
	RetryCount        int `toml:"retry" json:"retry"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL