Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Log *logging.Logger
Log is the logger used throughout the node's process.
View Source
var TimeoutChannel chan bool = make(chan bool)
TimeoutChannel is the channel used for kicking off leader election when a node has not received a leader heartbeat in a while.
Functions ¶
func GenerateTimeout ¶
GenerateTimeout returns a timeout value between average - jitter and average + jitter.
func SetLogLevel ¶
func SetLogLevel(level string)
SetLogLevel sets the log level based on the config.yaml log_level value.
Types ¶
type ConfigMap ¶
type ConfigMap struct { LogLevel string `yaml:"log_level"` ElectionTimeout uint32 `yaml:"election_timeout"` ElectionTimeoutJitter uint32 `yaml:"election_timeout_jitter"` LeaderHeartbeatPeriod uint32 `yaml:"leader_heartbeat_period"` NodeId string `yaml:"node_id"` Nodes map[string]NodeHost `yaml:"node_hosts"` }
ConfigMap contains all the configurations loaded from the config file.
var Config ConfigMap
Config contains the loaded configurations.
func LoadConfig ¶
func LoadConfig() ConfigMap
LoadConfig loads the config map from config.yaml into Config.
Click to show internal directories.
Click to hide internal directories.