conf

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugMode   = "debug"
	ReleaseMode = "release"
	TestMode    = "test"
)

Variables

This section is empty.

Functions

func Init

func Init() (err error)

Init init config.

Types

type Bucket

type Bucket struct {
	Size          int
	Channel       int
	Groups        int
	RoutineAmount uint64
	RoutineSize   int
}

Bucket is bucket config.

type Config

type Config struct {
	Env            string
	Log            xlog.Config
	Trace          traceConfig.Configuration
	Reg            *Reg
	TCP            *TCP
	Websocket      *Websocket
	Protocol       *Protocol
	Bucket         *Bucket
	LogicRPCClient *RPCClient
	RPCServer      *RPCServer
}

Config is comet config.

var (

	// Conf config
	Conf *Config
)

func Default

func Default() *Config

Default new a config with specified defualt value.

type Protocol

type Protocol struct {
	Timer            int
	TimerSize        int
	Task             int
	TaskSize         int
	SvrProto         int
	CliProto         int
	HandshakeTimeout xtime.Duration
	MinHeartbeat     xtime.Duration
	MaxHeartbeat     xtime.Duration
	TaskDuration     xtime.Duration
	Rto              xtime.Duration
}

Protocol is protocol config.

type RPCClient

type RPCClient struct {
	Schema  string
	SrvName string // call
	Dial    xtime.Duration
	Timeout xtime.Duration
}

RPCClient is RPC client config.

type RPCServer

type RPCServer struct {
	Network           string
	Addr              string
	Timeout           xtime.Duration
	IdleTimeout       xtime.Duration
	MaxLifeTime       xtime.Duration
	ForceCloseWait    xtime.Duration
	KeepAliveInterval xtime.Duration
	KeepAliveTimeout  xtime.Duration
}

RPCServer is RPC server config.

type Reg

type Reg struct {
	Schema   string
	SrvName  string // call
	RegAddrs string // etcd addrs, seperate by ','
}

Reg is service register/discovery config

type TCP

type TCP struct {
	Bind         []string
	Sndbuf       int
	Rcvbuf       int
	KeepAlive    bool
	Reader       int
	ReadBuf      int
	ReadBufSize  int
	Writer       int
	WriteBuf     int
	WriteBufSize int
}

TCP is tcp config.

type Websocket

type Websocket struct {
	Bind        []string
	TLSOpen     bool
	TLSBind     []string
	CertFile    string
	PrivateFile string
}

Websocket is websocket config.

Jump to

Keyboard shortcuts

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