featureprovider

package
v0.2.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EtcdFeatureProviders = make(map[string]FeatureFactory)
)

Functions

func ListFeatureProvider

func ListFeatureProvider() []string

ListFeatureProvider lists all feature provider

func RegisterFeatureFactory

func RegisterFeatureFactory(name string, factory FeatureFactory)

RegisterFeatureFactory registers the specified feature provider

Types

type Feature

type Feature interface {
	// Equal checks whether the feature needs to be updated
	Equal(cluster *v1alpha2.EtcdCluster) bool

	// Sync synchronizes the latest feature configuration
	Sync(cluster *v1alpha2.EtcdCluster) error

	// Do executes inspection tasks.
	Do(task *v1alpha2.EtcdInspection) error
}

Feature is an abstract, pluggable interface for cluster features.

func GetFeatureProvider

func GetFeatureProvider(name string, ctx *FeatureContext) (Feature, error)

GetFeatureProvider gets the specified feature provider

type FeatureContext

type FeatureContext struct {
	ClientBuilder      util.ClientBuilder
	ClientConfigGetter etcd.ClientConfigGetter
}

type FeatureFactory

type FeatureFactory func(cfg *FeatureContext) (Feature, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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