Documentation
¶
Index ¶
- func GetConfigAsJSON() string
- func GetDefaultSystemConfig() config.SystemConfig
- func GetModuleConfig(name string) *config.Config
- func GetPluginConfig(name string) *config.Config
- func GetStartTime() time.Time
- func LoadConfigContents(path string) (contents string, err error)
- func ParseConfig(configKey string, configInstance interface{}) (exist bool, err error)
- func ParseConfigSection(cfg *config.Config, configKey string, configInstance interface{}) (exist bool, err error)
- type Application
- type Env
- func (env *Env) CheckSetup()
- func (env *Env) EnableSetup(b bool)
- func (env *Env) GetAppCapitalName() string
- func (env *Env) GetAppDesc() string
- func (env *Env) GetAppLowercaseName() string
- func (env *Env) GetAppName() string
- func (env *Env) GetApplicationInfo() Application
- func (env *Env) GetBuildDate() time.Time
- func (env *Env) GetBuildNumber() string
- func (env *Env) GetConfig(key string, defaultV string) (string, bool)
- func (env *Env) GetConfigDir() string
- func (env *Env) GetConfigFile() string
- func (env *Env) GetDataDir() string
- func (env *Env) GetEOLDate() time.Time
- func (env *Env) GetGoodbyeMessage() string
- func (env *Env) GetHTTPClientConfig(name, endpoint string) *config.HTTPClientConfig
- func (env *Env) GetLastCommitHash() string
- func (env *Env) GetLastFrameworkCommitHash() string
- func (env *Env) GetLastFrameworkVendorCommitHash() string
- func (env *Env) GetLogDir() string
- func (env *Env) GetOverallHealth() HealthType
- func (env *Env) GetPluginDir() string
- func (env *Env) GetServicesHealth() map[string]string
- func (env *Env) GetState() int32
- func (env *Env) GetVersion() string
- func (env *Env) GetVersionInfo() Version
- func (env *Env) GetWelcomeMessage() string
- func (env *Env) Init() *Env
- func (env *Env) InitPaths(cfgPath string) error
- func (env *Env) RefreshConfig() error
- func (env *Env) ReportHealth(service string, health HealthType)
- func (env *Env) SetConfigFile(configFile string) *Env
- func (env *Env) SetupRequired() bool
- func (env *Env) UpdateState(i int32)
- type HealthType
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfigAsJSON ¶
func GetConfigAsJSON() string
func GetDefaultSystemConfig ¶
func GetDefaultSystemConfig() config.SystemConfig
func GetModuleConfig ¶
GetModuleConfig return specify module's config
func GetPluginConfig ¶
GetPluginConfig return specify plugin's config
func GetStartTime ¶
func LoadConfigContents ¶
LoadConfigContents reads contents from the given path, and renders template variables if necessary.
func ParseConfig ¶
Types ¶
type Application ¶
type Application struct { Name string `json:"name,omitempty" elastic_mapping:"name:{type:keyword,fields:{text: {type: text}}}"` Version Version `json:"version,omitempty" elastic_mapping:"version: { type: object }"` Tagline string `json:"tagline,omitempty" elastic_mapping:"tagline: { type: keyword }"` }
type Env ¶
type Env struct { // static configs SystemConfig *config.SystemConfig IsDebug bool IsDaemonMode bool ISServiceMode bool LoggingLevel string IgnoreOnConfigMissing bool // contains filtered or unexported fields }
Env is environment object of app
func NewEnv ¶
func NewEnv(name, desc, ver, buildNumber, commit, buildDate, eolDate, terminalHeader, terminalFooter string) *Env
EmptyEnv return a empty env instance
func (*Env) CheckSetup ¶
func (env *Env) CheckSetup()
func (*Env) EnableSetup ¶
func (*Env) GetAppCapitalName ¶
func (*Env) GetAppDesc ¶
func (*Env) GetAppLowercaseName ¶
func (*Env) GetAppName ¶
func (*Env) GetApplicationInfo ¶
func (env *Env) GetApplicationInfo() Application
func (*Env) GetBuildDate ¶
GetBuildDate returns the build datetime of current package
func (*Env) GetBuildNumber ¶
func (*Env) GetConfigDir ¶
func (*Env) GetConfigFile ¶
func (*Env) GetDataDir ¶
GetDataDir returns root working dir of app instance
func (*Env) GetEOLDate ¶
func (*Env) GetGoodbyeMessage ¶
func (*Env) GetHTTPClientConfig ¶ added in v1.1.0
func (env *Env) GetHTTPClientConfig(name, endpoint string) *config.HTTPClientConfig
func (*Env) GetLastCommitHash ¶
func (*Env) GetLastFrameworkCommitHash ¶ added in v1.1.0
func (*Env) GetLastFrameworkVendorCommitHash ¶ added in v1.1.0
func (*Env) GetOverallHealth ¶
func (env *Env) GetOverallHealth() HealthType
func (*Env) GetPluginDir ¶
func (*Env) GetServicesHealth ¶
func (*Env) GetVersion ¶
GetVersion returns the version of this build
func (*Env) GetVersionInfo ¶
func (*Env) GetWelcomeMessage ¶
func (*Env) RefreshConfig ¶
func (*Env) ReportHealth ¶
func (env *Env) ReportHealth(service string, health HealthType)
func (*Env) SetConfigFile ¶
func (*Env) SetupRequired ¶
func (*Env) UpdateState ¶
type HealthType ¶
type HealthType int
const HEALTH_GREEN HealthType = 1
const HEALTH_RED HealthType = 3
const HEALTH_UNAVAILABLE HealthType = 4
const HEALTH_UNKNOWN HealthType = 0
const HEALTH_YELLOW HealthType = 2
func GetHealthType ¶
func GetHealthType(health string) HealthType
func (HealthType) ToString ¶
func (h HealthType) ToString() string
type Version ¶
type Version struct { VersionNumber string `json:"number,omitempty"` FrameworkBuildCommitHash string `json:"framework_hash,omitempty"` FrameworkVendorBuildCommitHash string `json:"vendor_hash,omitempty"` BuildCommitHash string `json:"build_hash,omitempty"` BuildDate string `json:"build_date,omitempty"` BuildNumber string `json:"build_number,omitempty"` EolDate string `json:"eol_date,omitempty"` }
Click to show internal directories.
Click to hide internal directories.