Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrorParamEmpty liberr.CodeError = iota + liberr.MinPkgConfig ErrorConfigMissingViper ErrorComponentNotFound ErrorComponentFlagError ErrorComponentConfigNotFound ErrorComponentConfigError ErrorComponentStart ErrorComponentReload )
View Source
const ( MinErrorComponentAws = ErrorParamEmpty + 10 MinErrorComponentDatabase = MinErrorComponentAws + 10 MinErrorComponentHead = MinErrorComponentDatabase + 10 MinErrorComponentHttp = MinErrorComponentHead + 10 MinErrorComponentLdap = MinErrorComponentHttp + 10 MinErrorComponentLog = MinErrorComponentLdap + 10 MinErrorComponentMail = MinErrorComponentLog + 10 MinErrorComponentNats = MinErrorComponentMail + 10 MinErrorComponentNutsDB = MinErrorComponentNats + 10 MinErrorComponentRequest = MinErrorComponentNutsDB + 10 MinErrorComponentSmtp = MinErrorComponentRequest + 10 MinErrorComponentTls = MinErrorComponentSmtp + 10 )
Variables ¶
This section is empty.
Functions ¶
func ShellCommandInfo ¶ added in v1.11.3
func ShellCommandInfo() []shlcmd.CommandInfo
func WaitNotify ¶ added in v1.10.0
func WaitNotify()
Types ¶
type Config ¶
type Config interface { // Context return the config context instance Context() libctx.Config[string] // CancelAdd allow to register a slice of custom function called on cancel context. // On context cancel event or signal kill, term... this function will be called // before config stop and main context cancel function CancelAdd(fct ...func()) // CancelClean allow clear the all Cancel func registered into slice CancelClean() // Start will trigger the start function of all registered component. // If any component return an error, this func will stop the start // process and return the error. Start() error // Reload triggers the Reload function of each registered Component. Reload() error // Stop will trigger the stop function of all registered component. // All component must stop cleanly. Stop() // Shutdown will trigger all stop function. // This function will call the Stop function and the private function cancel. // This will stop all process and do like a SIGTERM/SIGINT signal. // This will finish by an os.Exit with the given parameter code. Shutdown(code int) // RegisterFuncViper is used to expose golib Viper instance to all config component. // With this function, the component can load his own config part and start or reload. RegisterFuncViper(fct libvpr.FuncViper) // RegisterFuncStartBefore allow to register a func to be call when the config Start // is trigger. This func is call before the start sequence. RegisterFuncStartBefore(fct FuncEvent) // RegisterFuncStartAfter allow to register a func to be call when the config Start // is trigger. This func is call after the start sequence. RegisterFuncStartAfter(fct FuncEvent) // RegisterFuncReloadBefore allow to register a func to be call when the config Reload // is trigger. This func is call before the reload sequence. RegisterFuncReloadBefore(fct FuncEvent) // RegisterFuncReloadAfter allow to register a func to be call when the config Reload // is trigger. This func is call after the reload sequence. RegisterFuncReloadAfter(fct FuncEvent) // RegisterFuncStopBefore allow to register a func to be call when the config Stop // is trigger. This func is call before the stop sequence. RegisterFuncStopBefore(fct FuncEvent) // RegisterFuncStopAfter allow to register a func to be call when the config Stop // is trigger. This func is call after the stop sequence. RegisterFuncStopAfter(fct FuncEvent) // RegisterDefaultLogger allow to register a func to return a default logger. // This logger can be used by component to extend config ot to log message. RegisterDefaultLogger(fct liblog.FuncLog) /* // Section Component : github.com/nabbar/golib/config */ cfgtps.ComponentList cfgtps.ComponentMonitor /* // Section Shell Command : github.com/nabbar/golib/shell */ GetShellCommand() []shlcmd.Command }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.