config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Dev 判断是否开发状态
	Dev bool
	// ConfPath 配置文件位置
	ConfPath string
)

Functions

func GetLogConf

func GetLogConf() *logger.LogConifg

GetLogConf Get log conf

func InitConfig

func InitConfig()

InitConfig 初始化配置

Types

type AllConfig

type AllConfig struct {
	ChainId      string            `mapstructure:"chain_id"`
	AuthType     string            `mapstructure:"auth_type"`
	ContractMock string            `mapstructure:"contract_mock"`
	ContractName string            `mapstructure:"contract_name"`
	SdkConfFile  string            `mapstructure:"sdk_conf_file"`
	UserConfig   *UserConfig       `mapstructure:"user"`
	LogConfig    *logger.LogConifg `mapstructure:"log"`
	NetConfig    *NetConfig        `mapstructure:"net"`
	ServerConfig *ServerConfig     `mapstructure:"server"`
}

AllConfig 所有配置对应的结构体

func GetAllConf

func GetAllConf() *AllConfig

GetAllConf Get all conf

func ParseAllConf

func ParseAllConf() (*AllConfig, error)

ParseAllConf parse all conf

type NetConfig

type NetConfig struct {
	Provider                string       `mapstructure:"provider"`
	ListenAddr              string       `mapstructure:"listen_addr"`
	PeerStreamPoolSize      int          `mapstructure:"peer_stream_pool_size"`
	MaxPeerCountAllow       int          `mapstructure:"max_peer_count_allow"`
	PeerEliminationStrategy int          `mapstructure:"peer_elimination_strategy"`
	CaPath                  []string     `mapstructure:"ca"`
	Seeds                   []string     `mapstructure:"seeds"`
	TLSConfig               netTlsConfig `mapstructure:"tls"`
}

NetConfig 网络配置

func GetNetConf

func GetNetConf() *NetConfig

GetNetConf Get net conf

type ServerConfig

type ServerConfig struct {
	ListenAddr string `mapstructure:"listen_addr"`
}

ServerConfig 服务配置

func GetServerConf

func GetServerConf() *ServerConfig

GetServerConf Get server conf

type UserConfig

type UserConfig struct {
	PrivKeyFile string `mapstructure:"sign_priv_key_file"`
	CertFile    string `mapstructure:"sign_cert_file"`
	Hash        string `mapstructure:"hash"`
}

UserConfig 用户配置

func GetUserConf

func GetUserConf() *UserConfig

GetUserConf Get user conf

Jump to

Keyboard shortcuts

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