config

package
v0.0.0-...-1df5a02 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// node
	NodeId            int
	NodeWeight        int
	MsgTTR            int
	MsgMaxRetry       int
	MsgMaxPushNum     int
	DataSavePath      string
	EnableCluster     bool
	HeartbeatInterval int

	// RegisterAddr
	RegisterAddr string

	// etcd
	EtcdEndPoints []string

	// http server
	HttpServAddr      string
	HttpServEnableTls bool
	HttpServCertFile  string
	HttpServKeyFile   string

	// tcp server
	TcpServAddr      string
	TcpServEnableTls bool
	TcpServCertFile  string
	TcpServKeyFile   string

	// report addr
	ReportHttpAddr string
	ReportTcpAddr  string

	// log
	LogTargetType string
	LogFilename   string
	LogLevel      int
	LogMaxSize    int
	LogRotate     bool
}

func LoadConfigFromFile

func LoadConfigFromFile(cfgFile string) (*Config, error)

func NewConfig

func NewConfig() (*Config, error)

func (*Config) SetDefault

func (c *Config) SetDefault()

func (*Config) Validate

func (c *Config) Validate() error

Jump to

Keyboard shortcuts

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