Documentation ¶
Index ¶
- Constants
- func EncodeGlobalConfig(conf GlobalConfig) string
- func GetFlagSet() *flag.FlagSet
- func ParseFlag()
- func PrintUsage()
- func WatchGlobalConfig(etcd *etcd.Etcd, watcher Watcher) error
- type ClusterServiceConfig
- type Config
- type EtcdConfig
- type GlobalConfig
- type LogConfig
- type MysqlConfig
- type RepoServiceConfig
- type Watcher
Constants ¶
View Source
const ( EtcdPrefix = "openpitrix/" GlobalConfigKey = "global_config" DlockKey = "dlock_" + GlobalConfigKey )
View Source
const InitialGlobalConfig = `` /* 817-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func EncodeGlobalConfig ¶
func EncodeGlobalConfig(conf GlobalConfig) string
func GetFlagSet ¶
func PrintUsage ¶
func PrintUsage()
Types ¶
type ClusterServiceConfig ¶
type ClusterServiceConfig struct {
Plugins []string `json:"plugins"`
}
type Config ¶
type Config struct { Log LogConfig Mysql MysqlConfig Etcd EtcdConfig }
type EtcdConfig ¶
type EtcdConfig struct {
Endpoints string `default:"openpitrix-etcd:2379"` // Example: "localhost:2379,localhost:22379,localhost:32379"
}
type GlobalConfig ¶
type GlobalConfig struct { Repo RepoServiceConfig `json:"repo"` Cluster ClusterServiceConfig `json:"cluster"` }
func DecodeInitConfig ¶
func DecodeInitConfig() GlobalConfig
type LogConfig ¶
type LogConfig struct {
Level string `default:"info"` // debug, info, warn, error, fatal
}
type MysqlConfig ¶
type MysqlConfig struct { Host string `default:"openpitrix-db"` Port string `default:"3306"` User string `default:"root"` Password string `default:"password"` Database string `default:"openpitrix"` }
func (*MysqlConfig) GetUrl ¶
func (m *MysqlConfig) GetUrl() string
type RepoServiceConfig ¶
type RepoServiceConfig struct {
Cron string `json:"cron"`
}
type Watcher ¶
type Watcher chan *GlobalConfig
Click to show internal directories.
Click to hide internal directories.