Documentation ¶
Overview ¶
Package rkboot is bootstrapper for rk style application
Index ¶
- type Boot
- func (boot *Boot) AddShutdownHookFunc(name string, f rkentry.ShutdownHook)
- func (boot *Boot) Bootstrap(ctx context.Context)
- func (boot *Boot) GetAppInfoEntry() *rkentry.AppInfoEntry
- func (boot *Boot) GetCertEntry(name string) *rkentry.CertEntry
- func (boot *Boot) GetConfigEntry(name string) *rkentry.ConfigEntry
- func (boot *Boot) GetEntry(name string) interface{}
- func (boot *Boot) GetEventLoggerEntry(name string) *rkentry.EventLoggerEntry
- func (boot *Boot) GetEventLoggerEntryDefault() *rkentry.EventLoggerEntry
- func (boot *Boot) GetZapLoggerEntry(name string) *rkentry.ZapLoggerEntry
- func (boot *Boot) GetZapLoggerEntryDefault() *rkentry.ZapLoggerEntry
- func (boot *Boot) WaitForShutdownSig(ctx context.Context)
- type BootOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Boot ¶
type Boot struct { BootConfigPath string `yaml:"bootConfigPath" json:"bootConfigPath"` EventId string `yaml:"eventId" json:"eventId"` }
Boot is a structure for bootstrapping rk style application
func (*Boot) AddShutdownHookFunc ¶ added in v1.2.0
AddShutdownHookFunc add shutdown hook function
func (*Boot) Bootstrap ¶
Bootstrap entries in rkentry.GlobalAppCtx including bellow:
Internal entries: 1: rkentry.AppInfoEntry 2: rkentry.ConfigEntry 3: rkentry.ZapLoggerEntry 4: rkentry.EventLoggerEntry 5: rkentry.CertEntry
External entries: User defined entries
func (*Boot) GetAppInfoEntry ¶ added in v1.2.0
func (boot *Boot) GetAppInfoEntry() *rkentry.AppInfoEntry
GetAppInfoEntry returns rkentry.AppInfoEntry from rkentry.GlobalAppCtx.
func (*Boot) GetCertEntry ¶ added in v1.2.0
GetCertEntry returns rkentry.CertEntry from rkentry.GlobalAppCtx.
func (*Boot) GetConfigEntry ¶ added in v1.2.0
GetConfigEntry returns rkentry.ConfigEntry from rkentry.GlobalAppCtx.
func (*Boot) GetEntry ¶
GetEntry returns rkentry.Entry interface which user needs to convert by himself.
func (*Boot) GetEventLoggerEntry ¶ added in v1.2.0
GetEventLoggerEntry returns rkentry.EventLoggerEntry from rkentry.GlobalAppCtx.
func (*Boot) GetEventLoggerEntryDefault ¶ added in v1.2.0
func (boot *Boot) GetEventLoggerEntryDefault() *rkentry.EventLoggerEntry
GetEventLoggerEntryDefault returns default rkentry.EventLoggerEntry from rkentry.GlobalAppCtx.
func (*Boot) GetZapLoggerEntry ¶ added in v1.2.0
GetZapLoggerEntry returns rkentry.ZapLoggerEntry from rkentry.GlobalAppCtx.
func (*Boot) GetZapLoggerEntryDefault ¶ added in v1.2.0
func (boot *Boot) GetZapLoggerEntryDefault() *rkentry.ZapLoggerEntry
GetZapLoggerEntryDefault returns default rkentry.ZapLoggerEntry from rkentry.GlobalAppCtx.
func (*Boot) WaitForShutdownSig ¶ added in v1.2.0
WaitForShutdownSig wait for shutdown signal. 1: Call shutdown hook function added by user. 2: Call interrupt function of entries in rkentry.GlobalAppCtx.
type BootOption ¶
type BootOption func(*Boot)
BootOption is used as options while bootstrapping from code
func WithBootConfigPath ¶
func WithBootConfigPath(filePath string) BootOption
WithBootConfigPath provide boot config yaml file.