env

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetModuleConfig

func GetModuleConfig(name string) *config.Config

GetModuleConfig return specify module's config

func GetPluginConfig

func GetPluginConfig(name string) *config.Config

GetPluginConfig return specify plugin's config

func GetStartTime

func GetStartTime() time.Time

func ParseConfig

func ParseConfig(configKey string, configInstance interface{}) (exist bool, err error)

Types

type Env

type Env struct {

	// static configs
	SystemConfig *config.SystemConfig

	IsDebug      bool
	IsDaemonMode bool

	LoggingLevel string
	// contains filtered or unexported fields
}

Env is environment object of app

func EmptyEnv

func EmptyEnv() *Env

func NewEnv

func NewEnv(name, desc, ver, commit, buildDate, terminalHeader, terminalFooter string) *Env

EmptyEnv return a empty env instance

func (*Env) GetAppCapitalName

func (env *Env) GetAppCapitalName() string

func (*Env) GetAppDesc

func (env *Env) GetAppDesc() string

func (*Env) GetAppLowercaseName

func (env *Env) GetAppLowercaseName() string

func (*Env) GetAppName

func (env *Env) GetAppName() string

func (*Env) GetBuildDate

func (env *Env) GetBuildDate() string

GetBuildDate returns the build datetime of current package

func (*Env) GetGoodbyeMessage

func (env *Env) GetGoodbyeMessage() string

func (*Env) GetLastCommitHash

func (env *Env) GetLastCommitHash() string

func (*Env) GetLastCommitLog

func (env *Env) GetLastCommitLog() string

GetLastCommitLog returns last commit information of source code

func (*Env) GetVersion

func (env *Env) GetVersion() string

GetVersion returns the version of this build

func (*Env) GetWelcomeMessage

func (env *Env) GetWelcomeMessage() string

func (*Env) GetWorkingDir

func (env *Env) GetWorkingDir() string

GetWorkingDir returns root working dir of app instance

func (*Env) Init

func (env *Env) Init() *Env

Environment create a new env instance from a config

func (*Env) SetConfigFile

func (env *Env) SetConfigFile(configFile string) *Env

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL