Documentation ¶
Index ¶
- type FlavorLocal
- func (f *FlavorLocal) InfraDeps(pluginName string) *PluginInfraDeps
- func (f *FlavorLocal) Inject() bool
- func (f *FlavorLocal) LogDeps(pluginName string) *PluginLogDeps
- func (f *FlavorLocal) LogRegistry() logging.Registry
- func (f *FlavorLocal) LoggerFor(pluginName string) logging.PluginLogger
- func (f *FlavorLocal) Plugins() []*core.NamedPlugin
- type PluginInfraDeps
- type PluginLogDeps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FlavorLocal ¶
type FlavorLocal struct { ServiceLabel servicelabel.Plugin StatusCheck statuscheck.Plugin // contains filtered or unexported fields }
FlavorLocal glues together very minimal subset of cn-infra plugins that can be embeddable inside different project without running any agent specific server.
func (*FlavorLocal) InfraDeps ¶
func (f *FlavorLocal) InfraDeps(pluginName string) *PluginInfraDeps
InfraDeps for getting PlugginInfraDeps instance: - config file is preinitialized by pluginName (see config.ForPlugin method) This method is just convenient shortcut for Flavor.Inject()
func (*FlavorLocal) Inject ¶
func (f *FlavorLocal) Inject() bool
Inject does nothing (it is here for potential later extensibility) Composite flavors embedding local flavor are supposed to call this method.
func (*FlavorLocal) LogDeps ¶
func (f *FlavorLocal) LogDeps(pluginName string) *PluginLogDeps
LogDeps for getting PlugginLofDeps instance. - pluginName argument value is assigned to Plugin - logger name is pre-initialized (see logging.ForPlugin) This method is just convenient shortcut for Flavor.Inject()
func (*FlavorLocal) LogRegistry ¶
func (f *FlavorLocal) LogRegistry() logging.Registry
LogRegistry for getting Logging Registry instance (not thread safe)
func (*FlavorLocal) LoggerFor ¶
func (f *FlavorLocal) LoggerFor(pluginName string) logging.PluginLogger
LoggerFor for getting PlugginLogger instance: - logger name is pre-initialized (see logging.ForPlugin) This method is just convenient shortcut for Flavor.Inject()
func (*FlavorLocal) Plugins ¶
func (f *FlavorLocal) Plugins() []*core.NamedPlugin
Plugins combines all Plugins in flavor to the list
type PluginInfraDeps ¶ added in v1.0.3
type PluginInfraDeps struct { PluginLogDeps // inject config.PluginConfig // inject StatusCheck statuscheck.PluginStatusWriter // inject ServiceLabel servicelabel.ReaderAPI // inject }
PluginInfraDeps is standard set of plugin dependencies that will need probably every connector to DB/Messaging: - to report/write plugin status to StatusCheck - to know micro-service label prefix
type PluginLogDeps ¶ added in v1.0.3
type PluginLogDeps struct { Log logging.PluginLogger //inject PluginName core.PluginName //inject }
PluginLogDeps is minimal set of plugin dependencies that will probably use every plugin to: - log using plugin logger or child (prefixed) logger (if plugin needs more than one) - to know the PluginName
func (*PluginLogDeps) Close ¶ added in v1.0.3
func (plugin *PluginLogDeps) Close() error
Close is called by Agent Core when the Agent is shutting down. It is supposed to clean up resources that were allocated by the plugin during its lifetime. This is default empty implementation to not bother plugins that does not need to implement this method.