Documentation ¶
Overview ¶
Example (UnmarshalInitConfig) ¶
package main import ( "openpitrix.io/openpitrix/pkg/config" "openpitrix.io/openpitrix/pkg/logger" ) func main() { globalConfig := config.DecodeInitConfig() logger.Info(nil, "Got global config: \n%+v\n", globalConfig) logger.Info(nil, "Get global config string: \n%s\n", config.EncodeGlobalConfig(globalConfig)) }
Output:
Index ¶
- Constants
- func EncodeGlobalConfig(conf GlobalConfig) string
- func GetFlagSet() *flag.FlagSet
- func ParseFlag()
- func PrintUsage()
- type AppServiceConfig
- type ClusterServiceConfig
- type Config
- type EtcdConfig
- type GlobalConfig
- type GrpcConfig
- type IAMConfig
- type ImageConfig
- type JobServiceConfig
- type LogConfig
- type MysqlConfig
- type PilotServiceConfig
- type RepoServiceConfig
- type TaskServiceConfig
Examples ¶
Constants ¶
View Source
const InitialGlobalConfig = `` /* 1716-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 AppServiceConfig ¶ added in v0.2.1
type AppServiceConfig struct {
DefaultDraftStatus bool `json:"default_draft_status"`
}
type ClusterServiceConfig ¶
type Config ¶
type Config struct { Log LogConfig Grpc GrpcConfig Mysql MysqlConfig Etcd EtcdConfig IAM IAMConfig }
type EtcdConfig ¶
type EtcdConfig struct {
Endpoints string `default:"openpitrix-etcd:2379"` // Example: "localhost:2379,localhost:22379,localhost:32379"
}
type GlobalConfig ¶
type GlobalConfig struct { App AppServiceConfig `json:"app"` Repo RepoServiceConfig `json:"repo"` Cluster ClusterServiceConfig `json:"cluster"` Runtime map[string]ImageConfig `json:"runtime"` Pilot PilotServiceConfig `json:"pilot"` Job JobServiceConfig `json:"job"` Task TaskServiceConfig `json:"task"` }
func DecodeInitConfig ¶
func DecodeInitConfig() GlobalConfig
func ParseGlobalConfig ¶
func ParseGlobalConfig(data []byte) (GlobalConfig, error)
func (*GlobalConfig) GetAppDefaultStatus ¶ added in v0.2.1
func (g *GlobalConfig) GetAppDefaultStatus() string
func (*GlobalConfig) GetRuntimeImageIdAndUrl ¶ added in v0.1.5
func (g *GlobalConfig) GetRuntimeImageIdAndUrl(apiServer, zone string) (*ImageConfig, error)
type GrpcConfig ¶
type GrpcConfig struct {
ShowErrorCause bool `default:"false"` // show grpc error cause to frontend
}
type ImageConfig ¶
type JobServiceConfig ¶ added in v0.2.3
type JobServiceConfig struct {
MaxWorkingJobs int32 `json:"max_working_jobs"`
}
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"` Disable bool `default:"false"` }
func (*MysqlConfig) GetUrl ¶
func (m *MysqlConfig) GetUrl() string
type PilotServiceConfig ¶
type RepoServiceConfig ¶
type TaskServiceConfig ¶ added in v0.2.3
type TaskServiceConfig struct {
MaxWorkingTasks int32 `json:"max_working_tasks"`
}
Click to show internal directories.
Click to hide internal directories.