config

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	// Server uuid
	ServerId string `yaml:"server_id" json:"server_id"`
	// Redis 连接地址
	RedisUrl string `yaml:"redis_url" json:"redis_url"`
	// 哨兵 下使用的DB
	RedisSDBIndex int `yaml:"redis_sdb_index"  json:"redis_sdb_index"`
	// 主服务别名
	RedisMasterName string `yaml:"redis_master_name"   json:"redis_master_name"`
	// Redis 哨兵群组
	RedisSentinelGroup []string `yaml:"redis_sentinel_group" json:"redis_sentinel_group"`
	// ETCD 集群组
	ETCDClusterList []string `yaml:"etcd_cluster_list" json:"etcd_cluster_list"`
	// nats queue url
	NatsUrl string `yaml:"nats_url" json:"nats_url"`
	// 服务监听地址
	ListenAddr string `yaml:"listen_addr" json:"listen_addr"`
	// 日志级别
	LogLevel string `yaml:"log_level" json:"log_level"`
	LogFile  string `yaml:"log_file" json:"log_file"`
	// pprof
	Pprof bool `yaml:"pprof" json:"pprof"`
}

func Get

func Get() *Conf

Get 获取配置

func Initialize

func Initialize(path string) *Conf

Initialize 初始化配置

type ConfServer

type ConfServer struct {
	Id     uint32 `yaml:"id"`     // 网关ID(llk=1)
	Type   uint32 `yaml:"type"`   // 类型 (1聊天,2游戏)
	Host   string `yaml:"host"`   // 目标服务器
	Port   int32  `yaml:"port"`   // 目标端口
	Scheme string `yaml:"scheme"` // 连接协议 (ws,wss,http,https,tcp,udp,quic)
	Proto  string `yaml:"proto"`  // 消息协议 (json & protobuf)
}

Jump to

Keyboard shortcuts

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