conf

package
v0.0.0-...-31a32bb Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultKafka

func DefaultKafka() []kafka.ConsumerGroupConf

func InitConfig

func InitConfig(path string) (err error)

Types

type CometInvoker

type CometInvoker struct {
	RoutineNum     int `yaml:"routineNum"`     // 每个CometInvoker有RoutineNum个协程,用于消费Channel的消息
	ChanBufferSize int `yaml:"chanBufferSize"` // 每个协程对应1个Channel,1个Channel的缓冲区大小为ChanBufferSize
}

type Config

type Config struct {
	Name         string                    `yaml:"name"`         // 服务名
	Debug        bool                      `yaml:"debug"`        // 是否开启debug
	Discovery    *Discovery                `yaml:"discovery"`    // etcd的配置
	Kafka        []kafka.ConsumerGroupConf `yaml:"kafka"`        // Kafka的配置
	CometInvoker *CometInvoker             `yaml:"cometInvoker"` // Comet调用器配置
	Room         *Room                     `yaml:"room"`
}
var Conf *Config

type Discovery

type Discovery struct {
	Addr string `yaml:"addr"`
}

type Room

type Room struct {
	Batch    int              `yaml:"batch"`    // 每累计达到Batch数量的proto,发送一次批量消息到Room
	Interval newtime.Duration `yaml:"interval"` // 每间隔Interval的时间,发送一次批量消息到Room
}

Jump to

Keyboard shortcuts

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