conf

package
v0.0.0-...-d9ad550 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RUN_MODE_LOCAL     = "local"
	RUN_MODE_CONTAINER = "container"
	RUN_MODE_K8S       = "k8s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

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

Bucket is bucket config.

type Config

type Config struct {
	ServiceName   string `yaml:"service_name"`
	RunMode       string // dev test prod
	MaxProc       int
	ServerTick    xtime.Duration
	OnlineTick    xtime.Duration
	LogPath       string
	Env           *Env
	Discovery     *DiscoveryConf
	TCP           *TCP       `yaml:"tcp_server"`
	WebSocket     *WebSocket `yaml:"websocket_server"`
	Timer         *Timer
	ProtoSection  *ProtoSection
	Bucket        *Bucket
	RPCClient     *RPCClient `yaml:"rpc_lient"`
	RPCServer     *RPCServer `yaml:"rpc_server"`
	Zipkin        *zipkinConf
	MetricsServer struct {
		Addr string
	} `yaml:"metrics_server"`
}

Config is comet config.

func LoadConf

func LoadConf(curPath string) (*Config, error)

type DiscoveryConf

type DiscoveryConf struct {
	Addr string
}

type Env

type Env struct {
	Region string
	Zone   string
	Host   string
	Weight int64
}

Env is env config.

type ProtoSection

type ProtoSection struct {
	HandshakeTimeout xtime.Duration
	WriteTimeout     xtime.Duration
	SvrProto         int
	CliProto         int
}

ProtoSection is proto section.

type RPCClient

type RPCClient struct {
	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 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 Timer

type Timer struct {
	Timer     int
	TimerSize int
}

Timer is timer config.

type WebSocket

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

WebSocket is websocket config.

type Whitelist

type Whitelist struct {
	Whitelist []int64
	WhiteLog  string
}

Whitelist is white list config.

Jump to

Keyboard shortcuts

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