Documentation ¶
Index ¶
- Constants
- func CheckOrStoreClusterUuid(dirPath, id string, force bool) (err error)
- func CheckOrStoreConstCfg(fileDir, fileName string, cfg *ConstConfig) (ok bool, err error)
- func NewIllegalConfigError(configKey string) error
- type Config
- func (c *Config) CheckAndGetBool(key string) (bool, bool)
- func (c *Config) CheckAndGetString(key string) (string, bool)
- func (c *Config) GetBool(key string) bool
- func (c *Config) GetBoolWithDefault(key string, defval bool) bool
- func (c *Config) GetFloat(key string) float64
- func (c *Config) GetInt(key string) int
- func (c *Config) GetInt64(key string) int64
- func (c *Config) GetInt64WithDefault(key string, defaultVal int64) int64
- func (c *Config) GetIntWithDefault(key string, defaultVal int) int
- func (c *Config) GetSlice(key string) []interface{}
- func (c *Config) GetString(key string) string
- func (c *Config) GetStringSlice(key string) []string
- func (c *Config) GetValue(key string) interface{}
- func (c *Config) HasKey(key string) bool
- func (c *Config) SetString(key, val string)
- type ConstConfig
Constants ¶
View Source
const ( DefaultConstConfigFile = "constcfg" ClusterVersionFile = "CLUSTER-VERSION" ClusterUUID = "ClusterUUID" )
Variables ¶
This section is empty.
Functions ¶
func CheckOrStoreClusterUuid ¶ added in v1.34.0
func CheckOrStoreConstCfg ¶ added in v1.34.0
func CheckOrStoreConstCfg(fileDir, fileName string, cfg *ConstConfig) (ok bool, err error)
check listen port, raft replica port and raft heartbeat port
func NewIllegalConfigError ¶ added in v1.34.0
Types ¶
type Config ¶
type Config struct { Raw []byte // contains filtered or unexported fields }
Config defines the struct of a configuration in general.
func LoadConfigFile ¶
LoadConfigFile loads config information from a JSON file.
func LoadConfigString ¶
LoadConfigString loads config information from a JSON string.
func (*Config) CheckAndGetBool ¶ added in v1.34.0
GetBool returns a bool value for the config key.
func (*Config) CheckAndGetString ¶ added in v1.34.0
Check and get a string for the config key.
func (*Config) GetBoolWithDefault ¶ added in v1.34.0
returns a bool value for the config key with default val when not present
func (*Config) GetInt64WithDefault ¶ added in v1.34.0
GetInt64WithDefault returns a int64 value for the config key.
func (*Config) GetIntWithDefault ¶ added in v1.34.0
GetInt returns a int value for the config key with default value.
func (*Config) GetStringSlice ¶ added in v1.34.0
type ConstConfig ¶ added in v1.34.0
type ConstConfig struct { Listen string `json:"listen"` RaftReplicaPort string `json:"raftReplicaPort"` RaftHeartbetPort string `json:"raftHeartbetPort"` }
func (*ConstConfig) Equals ¶ added in v1.34.0
func (ccfg *ConstConfig) Equals(cfg *ConstConfig) bool
Click to show internal directories.
Click to hide internal directories.