Documentation ¶
Index ¶
- func GetPluginInitializers() map[string]InitFunc
- func RegisterPluginInitializer(name string, initFunc InitFunc)
- type DummyIndicatorPlugin
- func (d DummyIndicatorPlugin) GetSupportedBusinessIndicatorSpec() []apiworkload.ServiceBusinessIndicatorName
- func (d DummyIndicatorPlugin) GetSupportedBusinessIndicatorStatus() []apiworkload.ServiceBusinessIndicatorName
- func (d DummyIndicatorPlugin) GetSupportedExtendedIndicatorSpec() []string
- func (d DummyIndicatorPlugin) GetSupportedSystemIndicatorSpec() []apiworkload.ServiceSystemIndicatorName
- func (d DummyIndicatorPlugin) Name() string
- func (d DummyIndicatorPlugin) Run()
- type IndicatorGetter
- type IndicatorManager
- func (u *IndicatorManager) GetIndicatorSpec(nn types.NamespacedName) *apiworkload.ServiceProfileDescriptorSpec
- func (u *IndicatorManager) GetIndicatorSpecChan() chan types.NamespacedName
- func (u *IndicatorManager) GetIndicatorStatus(nn types.NamespacedName) *apiworkload.ServiceProfileDescriptorStatus
- func (u *IndicatorManager) GetIndicatorStatusChan() chan types.NamespacedName
- func (u *IndicatorManager) UpdateBusinessIndicatorSpec(nn types.NamespacedName, indicators []apiworkload.ServiceBusinessIndicatorSpec)
- func (u *IndicatorManager) UpdateBusinessIndicatorStatus(nn types.NamespacedName, ...)
- func (u *IndicatorManager) UpdateExtendedIndicatorSpec(nn types.NamespacedName, indicators []apiworkload.ServiceExtendedIndicatorSpec)
- func (u *IndicatorManager) UpdateSystemIndicatorSpec(nn types.NamespacedName, indicators []apiworkload.ServiceSystemIndicatorSpec)
- type IndicatorPlugin
- type IndicatorUpdater
- type InitFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPluginInitializers ¶
GetPluginInitializers returns initialized functions of indicator plugins
func RegisterPluginInitializer ¶
RegisterPluginInitializer is used to register user-defined indicator plugins
Types ¶
type DummyIndicatorPlugin ¶
type DummyIndicatorPlugin struct { SystemSpecNames []apiworkload.ServiceSystemIndicatorName BusinessSpecNames []apiworkload.ServiceBusinessIndicatorName BusinessStatusNames []apiworkload.ServiceBusinessIndicatorName ExtendedSpecNames []string }
func (DummyIndicatorPlugin) GetSupportedBusinessIndicatorSpec ¶
func (d DummyIndicatorPlugin) GetSupportedBusinessIndicatorSpec() []apiworkload.ServiceBusinessIndicatorName
func (DummyIndicatorPlugin) GetSupportedBusinessIndicatorStatus ¶
func (d DummyIndicatorPlugin) GetSupportedBusinessIndicatorStatus() []apiworkload.ServiceBusinessIndicatorName
func (DummyIndicatorPlugin) GetSupportedExtendedIndicatorSpec ¶ added in v0.4.1
func (d DummyIndicatorPlugin) GetSupportedExtendedIndicatorSpec() []string
func (DummyIndicatorPlugin) GetSupportedSystemIndicatorSpec ¶
func (d DummyIndicatorPlugin) GetSupportedSystemIndicatorSpec() []apiworkload.ServiceSystemIndicatorName
func (DummyIndicatorPlugin) Name ¶
func (d DummyIndicatorPlugin) Name() string
func (DummyIndicatorPlugin) Run ¶
func (d DummyIndicatorPlugin) Run()
type IndicatorGetter ¶
type IndicatorGetter interface { // GetIndicatorSpecChan + GetIndicatorStatusChan // returns a channel to obtain the whether an update action has been triggered. GetIndicatorSpecChan() chan types.NamespacedName GetIndicatorStatusChan() chan types.NamespacedName // GetIndicatorSpec + GetIndicatorStatus // for indicator get functions, IndicatorUpdater will return a channel to obtain the merged results. GetIndicatorSpec(_ types.NamespacedName) *apiworkload.ServiceProfileDescriptorSpec GetIndicatorStatus(_ types.NamespacedName) *apiworkload.ServiceProfileDescriptorStatus }
IndicatorGetter is used by spd controller as indicator notifier to trigger update real spd.
type IndicatorManager ¶
type IndicatorManager struct {
// contains filtered or unexported fields
}
func NewIndicatorManager ¶
func NewIndicatorManager() *IndicatorManager
func (*IndicatorManager) GetIndicatorSpec ¶
func (u *IndicatorManager) GetIndicatorSpec(nn types.NamespacedName) *apiworkload.ServiceProfileDescriptorSpec
func (*IndicatorManager) GetIndicatorSpecChan ¶
func (u *IndicatorManager) GetIndicatorSpecChan() chan types.NamespacedName
func (*IndicatorManager) GetIndicatorStatus ¶
func (u *IndicatorManager) GetIndicatorStatus(nn types.NamespacedName) *apiworkload.ServiceProfileDescriptorStatus
func (*IndicatorManager) GetIndicatorStatusChan ¶
func (u *IndicatorManager) GetIndicatorStatusChan() chan types.NamespacedName
func (*IndicatorManager) UpdateBusinessIndicatorSpec ¶ added in v0.4.0
func (u *IndicatorManager) UpdateBusinessIndicatorSpec(nn types.NamespacedName, indicators []apiworkload.ServiceBusinessIndicatorSpec)
func (*IndicatorManager) UpdateBusinessIndicatorStatus ¶ added in v0.4.0
func (u *IndicatorManager) UpdateBusinessIndicatorStatus(nn types.NamespacedName, indicators []apiworkload.ServiceBusinessIndicatorStatus)
func (*IndicatorManager) UpdateExtendedIndicatorSpec ¶ added in v0.4.1
func (u *IndicatorManager) UpdateExtendedIndicatorSpec(nn types.NamespacedName, indicators []apiworkload.ServiceExtendedIndicatorSpec)
func (*IndicatorManager) UpdateSystemIndicatorSpec ¶ added in v0.4.0
func (u *IndicatorManager) UpdateSystemIndicatorSpec(nn types.NamespacedName, indicators []apiworkload.ServiceSystemIndicatorSpec)
type IndicatorPlugin ¶
type IndicatorPlugin interface { // Run starts the main loop for indicator plugin Run() Name() string // GetSupportedBusinessIndicatorSpec + GetSupportedSystemIndicatorSpec + GetSupportedBusinessIndicatorStatus // Those methods below returns the supported indicator names, if any name // is not supported by any indicator plugin, the controller will clear in CR. GetSupportedBusinessIndicatorSpec() []apiworkload.ServiceBusinessIndicatorName GetSupportedSystemIndicatorSpec() []apiworkload.ServiceSystemIndicatorName GetSupportedExtendedIndicatorSpec() []string GetSupportedBusinessIndicatorStatus() []apiworkload.ServiceBusinessIndicatorName }
IndicatorPlugin represent an implementation for indicator sources; each plugin will implement its own indicator-obtain logic and use IndicatorUpdater to set the latest indicator info.
type IndicatorUpdater ¶
type IndicatorUpdater interface { // UpdateExtendedIndicatorSpec + UpdateBusinessIndicatorSpec + UpdateSystemIndicatorSpec + UpdateBusinessIndicatorStatus // for indicator add functions, IndicatorUpdater will try to merge them in local stores. UpdateExtendedIndicatorSpec(_ types.NamespacedName, _ []apiworkload.ServiceExtendedIndicatorSpec) UpdateBusinessIndicatorSpec(_ types.NamespacedName, _ []apiworkload.ServiceBusinessIndicatorSpec) UpdateSystemIndicatorSpec(_ types.NamespacedName, _ []apiworkload.ServiceSystemIndicatorSpec) UpdateBusinessIndicatorStatus(_ types.NamespacedName, _ []apiworkload.ServiceBusinessIndicatorStatus) }
IndicatorUpdater is used by IndicatorPlugin as a unified implementation to trigger indicator updating logic.
type InitFunc ¶
type InitFunc func(ctx context.Context, conf *controller.SPDConfig, extraConf interface{}, spdWorkloadInformer map[schema.GroupVersionResource]native.DynamicInformer, controlCtx *katalystbase.GenericContext, updater IndicatorUpdater) (IndicatorPlugin, error)
Click to show internal directories.
Click to hide internal directories.