config

package
v0.0.0-...-84ea768 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrokerConfig

type BrokerConfig struct {
	GRPC struct {
		Host     string
		CertPath string `toml:"cert_path"`
		Username string
		Password string
	}
}

type DBConfig

type DBConfig struct {
	Dialect         string
	Host            string
	Port            int
	Username        string
	Password        string
	Name            string
	TestName        string
	Charset         string
	ShutdownTimeout int // in seconds
}

type EmailConfig

type EmailConfig struct {
	SMTPUsername string
	SMTPPassword string
	SMTPAuthHost string
	SMTPHost     string
	SMTPPort     int
	Workers      int
	Timeout      int // in seconds
}

type EventsConfig

type EventsConfig struct {
	TickDelay int // in seconds
}

type NotificationConfig

type NotificationConfig struct {
	ServiceTopic string
	Email        EmailConfig
}

type PubsubConfig

type PubsubConfig struct {
	Debug bool
}

type RestAPIConfig

type RestAPIConfig struct {
	DB          DBConfig
	ServicePort int
}

type SignalsConfig

type SignalsConfig struct {
	ServiceTopic string
}

type StorageConfig

type StorageConfig struct {
	EnabledTicks []TickConfig
	GCPBucket    struct {
		RotateInterval int // in seconds
	}
}

type StrategyConfig

type StrategyConfig struct {
}

type SystemConfig

type SystemConfig struct {
	RestAPI      RestAPIConfig
	Tickers      map[string]TickerConfig
	Notification NotificationConfig
	Signals      SignalsConfig

	MQProvider  string
	ProjectName string
	Events      EventsConfig

	Pubsub PubsubConfig
	Broker BrokerConfig

	Trader  TraderConfig
	Storage StorageConfig
}

func CreateConfig

func CreateConfig(r io.ReadCloser) (*SystemConfig, error)

func Init

func Init() (*SystemConfig, error)

func LoadConfig

func LoadConfig(filePath string) (*SystemConfig, error)

type TickConfig

type TickConfig struct {
	Exchange          string
	CurrencyPair      string
	TickDelayDuration int // seconds
}

type TickerConfig

type TickerConfig struct {
	Enabled          bool
	URI              string            `toml:"uri"`
	ApiKey           string            `toml:"api_key"`
	EnabledTicks     map[string]bool   `toml:"enabled_ticks"`
	EnabledExchanges map[string]string `toml:"enabled_exchanges"`

	// gocryptotrader
	GRPC struct {
		Host     string
		CertPath string `toml:"cert_path"`
		Username string
		Password string
	}
}

type TraderConfig

type TraderConfig struct {
	Strategy map[string]StrategyConfig
}

Jump to

Keyboard shortcuts

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