config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitBrokerConfig

func InitBrokerConfig() error

func InitLogicConfig

func InitLogicConfig() error

Types

type BrokerConfig

type BrokerConfig struct {
	Logger LogConfig `mapstructure:"logger"`

	LogicDealer struct {
		Address string `mapstructure:"address"`
	} `mapstructure:"logic_dealer"`

	Broker struct {
		WebSocketAddress string `mapstructure:"ws_address"`
		GrpcAddress      string `mapstructure:"grpc_address"`
	} `mapstructure:"broker"`

	Ping struct {
		Interval time.Duration `mapstructure:"interval"`
		MaxWait  time.Duration `mapstructure:"maxWait"`
	} `mapstructure:"ping"`

	BrokerGrpcAddr string
}

func GetBrokerOpts

func GetBrokerOpts() *BrokerConfig

type LogConfig

type LogConfig struct {
	Level         string `mapstructure:"level"`
	FilePath      string `mapstructure:"filepath"`
	ListenAddress string `mapstructure:"listen_address"`
}

type LogicConfig

type LogicConfig struct {
	Logger LogConfig `mapstructure:"logger"`

	LogicDealer struct {
		ListenAddress string `mapstructure:"listen_address"`
	} `mapstructure:"logic_dealer"`

	MySQLConf struct {
		DSN             string `mapstructure:"dsn"`
		MaxIdleConn     int    `mapstructure:"max_idle_conn"`
		MaxOpenConn     int    `mapstructure:"max_open_conn"`
		ConnMaxLifeSecs int    `mapstructure:"conn_max_life_secs"`
		// 是否启动debug模式
		// 若开启则会打印具体的执行SQL
		Debug bool `mapstructure:"debug"`
	} `mapstructure:"mysql"`
}

func GetLogicOpts

func GetLogicOpts() *LogicConfig

Jump to

Keyboard shortcuts

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