Documentation ¶
Index ¶
- Constants
- func GetBuildTime() string
- func GetBuildVersion() string
- func GetCommitID() string
- func InitConfig(path string)
- func LoadConfig(conf *Config, path string)
- func SetConfigVersion(bv, bt, ci string)
- type Base
- type Config
- func (config *Config) CurrentByMasterNameDomainIp(masterName string) error
- func (this *Config) GetDataDir(model Model) string
- func (this *Config) GetDataDirBySlot(model Model, pid uint32) string
- func (this *Config) GetDatas(model Model) []string
- func (config *Config) GetEmbed() (*embed.Config, error)
- func (this *Config) GetLevel(model Model) string
- func (this *Config) GetLogDir(model Model) string
- func (config *Config) NewMonitor(model Model) monitoring.Monitor
- func (config *Config) Validate(model Model) error
- type GlobalCfg
- type MasterCfg
- type Masters
- type Model
- type PSCfg
- type RouterCfg
Constants ¶
View Source
const ( LocalSingleAddr = "127.0.0.1" LocalCastAddr = "0.0.0.0" )
Variables ¶
This section is empty.
Functions ¶
func GetBuildTime ¶
func GetBuildTime() string
func GetBuildVersion ¶
func GetBuildVersion() string
func GetCommitID ¶
func GetCommitID() string
func InitConfig ¶
func InitConfig(path string)
func LoadConfig ¶
func SetConfigVersion ¶
func SetConfigVersion(bv, bt, ci string)
Types ¶
type Config ¶
type Config struct { Global *GlobalCfg `toml:"global,omitempty" json:"global"` Masters Masters `toml:"masters,omitempty" json:"masters"` Router *RouterCfg `toml:"router,omitempty" json:"router"` PS *PSCfg `toml:"ps,omitempty" json:"ps"` }
func (*Config) CurrentByMasterNameDomainIp ¶
CurrentByMasterNameDomainIp find this machine domain.The main purpose of this function is to find the master from from multiple masters and set it‘s Field:self to true. The only criterion for judging is: Is the IP address the same with one of the masters?
func (*Config) GetDataDir ¶
func (*Config) GetDataDirBySlot ¶
func (*Config) NewMonitor ¶
func (config *Config) NewMonitor(model Model) monitoring.Monitor
type MasterCfg ¶
type MasterCfg struct { Base Name string `toml:"name,omitempty" json:"name"` Address string `toml:"address,omitempty" json:"address"` ApiPort uint16 `toml:"api_port,omitempty" json:"api_port"` EtcdPort uint16 `toml:"etcd_port,omitempty" json:"etcd_port"` EtcdPeerPort uint16 `toml:"etcd_peer_port,omitempty" json:"etcd_peer_port"` EtcdClientPort uint16 `toml:"etcd_client_port,omitempty" json:"etcd_client_port"` Self bool `json:"-"` SkipAuth bool `toml:"skip_auth,omitempty" json:"skip_auth"` PprofPort uint16 `toml:"pprof_port,omitempty" json:"pprof_port"` }
type Masters ¶
type Masters []*MasterCfg
func (Masters) ClientAddress ¶
new client use this function to get client urls
type PSCfg ¶
type PSCfg struct { Base RpcPort uint16 `toml:"rpc_port,omitempty" json:"rpc_port"` RaftHeartbeatPort uint16 `toml:"raft_heartbeat_port,omitempty" json:"raft_heartbeat_port"` RaftReplicatePort uint16 `toml:"raft_replicate_port,omitempty" json:"raft_replicate_port"` RaftHeartbeatInterval int `toml:"heartbeat_interval" json:"heartbeat-interval"` RaftRetainLogs uint64 `toml:"raft_retain_logs" json:"raft-retain-logs"` RaftReplicaConcurrency int `toml:"raft_replica_concurrency" json:"raft-replica-concurrency"` RaftSnapConcurrency int `toml:"raft_snap_concurrency" json:"raft-snap-concurrency"` EngineDWPTNum uint64 `toml:"engine_dwpt_num" json:"engine-dwpt-num"` MaxSize int64 `toml:"max_size" json:"max_size"` PprofPort uint16 `toml:"pprof_port" json:"pprof_port"` Private bool `toml:"private" json:"private"` //this ps is private if true you must set machine by dbConfig }
Click to show internal directories.
Click to hide internal directories.