Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Conf ¶
type Conf struct { Log *LogConf `yaml:"Log"` Httpd *HttpdConf `yaml:"Httpd"` Raft *RaftConf `yaml:"Raft"` }
全局配置
var ( // 配置路径 ConfPath = "./conf/config.yaml" Config *Conf )
func DefaultConf ¶
func DefaultConf() *Conf
func LoadConfig ¶
type LogConf ¶
type LogConf struct { Verbose int `yaml:"Verbose"` // 日志冗余度 Way string `yaml:"Way"` // 日志方式"console" | "file" Dir string `yaml:"Dir"` // 日志目录,仅当Way是"file"是需要 }
日志配置
type RaftConf ¶
type RaftConf struct { Enable bool `yaml:"Enable"` LocalID string `yaml:"ID"` Bind string `yaml:"Bind"` ClusterConfJson string `yaml:"ClusterConfJson"` Storage string `yaml:"Storage"` RootDir string `yaml:"RootDir"` TCPMaxPool int `yaml:"TCPMaxPool"` Timeout int64 `yaml:"Timeout"` // Raft算法commit超时时间,单位毫秒 LeaderWatchInterval int64 `yaml:"LeaderWatchInterval"` // 定时报告谁是Leader, 单位秒 }
Raft算法配置
Click to show internal directories.
Click to hide internal directories.