config

package
v0.0.0-...-fed60c2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDefault

func SetDefault(config *Config)

Types

type Config

type Config struct {
	Server Server `yaml:"server"`

	// Datastore config
	Datastore datastore.Config `yaml:"datastore"`

	OKX OKX `yaml:"okx"`
}

Config config for server

func NewConfig

func NewConfig() *Config

NewConfig returns a Config struct with default values

func ReadConfig

func ReadConfig(path, name, configType string) *Config

ReadConfig config for server

func (*Config) AddFlags

func (s *Config) AddFlags(fs *pflag.FlagSet, c *Config)

AddFlags adds flags to the specified FlagSet

func (*Config) Validate

func (s *Config) Validate() []error

Validate validate generic server run options

type OKX

type OKX struct {
	APIKey     string
	APISecret  string
	PassPhrase string
}

type Server

type Server struct {
	Model string
	// api server bind address
	BindAddr string
	// monitor metric path
	MetricPath string
	// PprofAddr the address for pprof to use while exporting profiling results.
	PprofAddr string
	// LeaderConfig for leader election
	LeaderConfig leaderConfig `yaml:"leader_config"`
}

Jump to

Keyboard shortcuts

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