config

package
v0.0.0-...-85cba55 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 NotificationConfig

type NotificationConfig struct {
	ServiceTopic string
	Email        EmailConfig
}

type RestAPIConfig

type RestAPIConfig struct {
	DB          DBConfig
	ServicePort int
}

type SignalsConfig

type SignalsConfig struct {
	ServiceTopic string
}

type SystemConfig

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

	MQProvider  string
	ProjectName string
}

func CreateConfig

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

func LoadConfig

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

type TickerConfig

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

Jump to

Keyboard shortcuts

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