conf

package
v0.0.0-...-261bb52 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() (err error)

Init is func to initial logic config

Types

type BaseConf

type BaseConf struct {
	PidFile   string   `mapstructure:"pid_file"`
	PprofBind []string `mapstructure:"pprof_bind"`
	MaxProc   int
}

BaseConf is struct of base config

type Config

type Config struct {
	Base  *BaseConf   `mapstructure:"base"`
	Redis *RedisConf  `mapstructure:"redis"`
	RPC   *RPCConf    `mapstructure:"rpc"`
	HTTP  *HTTPConf   `mapstructure:"http"`
	Log   *log.Config `mapstructure:"log"`
}

Config is struct of logic config

var (
	// Conf is config for logic server
	Conf *Config
)

func NewConfig

func NewConfig() *Config

NewConfig is func to create a logic config

type HTTPConf

type HTTPConf struct {
	Address           []string      `mapstructure:"address"`
	ReadTimeout       time.Duration `mapstructure:"read_timeout"`
	WriteTimeout      time.Duration `mapstructure:"write_timeout"`
	ReadHeaderTimeout time.Duration `mapstructure:"read_header_timeout"`
	IdleTimeout       time.Duration `mapstructure:"idle_timeout"`
}

HTTPConf is config for http server

type RPCConf

type RPCConf struct {
	Address []string `mapstructure:"address"`
}

RPCConf is config for logic rpc

type RedisConf

type RedisConf struct {
	Password    string        `mapstructure:"password"`
	Address     string        `mapstructure:"address"`
	DefaultDB   int           `mapstructure:"default_db"`
	MaxRetries  int           `mapstructure:"max_retries"`
	IdleTimeout time.Duration `mapstructure:"idle_timeout"`
}

RedisConf is struct of redis config

Jump to

Keyboard shortcuts

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