conf

package
v0.0.0-...-9fc3494 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2019 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 init config.

Types

type Comet

type Comet struct {
	//
	RoutineChan int
	//
	RoutineSize int
}

Comet is comet config.

type Config

type Config struct {
	Env       *Env
	Kafka     *Kafka
	Discovery *naming.Config
	Comet     *Comet
	Room      *Room
}

Config is job config.

var (

	// Conf config
	Conf *Config
)

func Default

func Default() *Config

Default new a config with specified defualt value.

type Env

type Env struct {
	Region    string
	Zone      string
	DeployEnv string
	Host      string
}

Env is env config.

type Kafka

type Kafka struct {
	Topic   string
	Group   string
	Brokers []string
}

Kafka is kafka config.

type Room

type Room struct {

	// 最大缓存的信息量,超过就推送给 comet,默认为 20 条。
	Batch int

	// 缓存的最大时间,超过就推送给 comet,默认为 1 秒。值太小会增加推送频率,太大会增加延迟。
	Signal xtime.Duration

	// 消息聚合 goroutine 等待多久都沒收到消息就自动 close
	Idle xtime.Duration
}

Room is room config. 房间消息聚合

Jump to

Keyboard shortcuts

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