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 conf

Types

type Address

type Address struct {
	Key  int8   `mapstructure:"key"`
	Addr string `mapstructure:"addr"`
}

Address is struct of rpc address

type BaseConf

type BaseConf struct {
	PidFile   string   `mapstructure:"pid_file"`
	ServerID  string   `mapstructure:"server_id"`
	PprofBind []string `mapstructure:"pprof_bind"`
	CertPath  string   `mapstructure:"cert_path"`
	KeyPath   string   `mapstructure:"key_path"`
	MaxProc   int      `mapstructure:"max_process"`
}

BaseConf is struct of base conf

type BucketConf

type BucketConf struct {
	Size          int    `mapstructure:"size"`
	Channel       int    `mapstructure:"channel"`
	Room          int    `mapstructure:"room"`
	RoutineAmount uint64 `mapstructure:"routine_amount"`
	RoutineSize   int    `mapstructure:"routine_size"`
	BroadcastSize int    `mapstructure:"broadcast_size"`
}

BucketConf is struct of BucketConf

type Config

type Config struct {
	Base      *BaseConf      `mapstructure:"base"`
	Log       *log.Config    `mapstructure:"log"`
	Websocket *WebsocketConf `mapstructure:"websocket"`
	Bucket    *BucketConf    `mapstructure:"bucket"`
	RPC       *RPCConf       `mapstructure:"rpc"`
}

Config is struct of comet conf

var (
	// Conf is var of conf
	Conf *Config
)

func NewConfig

func NewConfig() *Config

NewConfig is constructor of Config

type RPCConf

type RPCConf struct {
	LogicAddr []Address `mapstructure:"logic_bind"`
	CometAddr []Address `mapstructure:"comet_bind"`
}

RPCConf is struct of RPCConf

type WebsocketConf

type WebsocketConf struct {
	Bind            string        `mapstructure:"port"`
	WriteWait       time.Duration `mapstructure:"write_wait"`
	PongWait        time.Duration `mapstructure:"pong_wait"`
	PingPeriod      time.Duration `mapstructure:"ping_period"`
	MaxMessageSize  int64         `mapstructure:"max_message_size"`
	ReadBufferSize  int           `mapstructure:"read_buffer_size"`
	WriteBufferSize int           `mapstructure:"write_buffer_size"`
}

WebsocketConf is struct of websocket conf

Jump to

Keyboard shortcuts

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