plugin

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Init(config.Configuration, informers.SharedInformerFactory)
	Run(stopCh <-chan struct{})
	OnSync(*lbapi.LoadBalancer)
}

Interface defines a pluggable proxy interface

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry ...

func NewRegistry

func NewRegistry() *Registry

NewRegistry ...

func (*Registry) AllInterfaces

func (r *Registry) AllInterfaces() []string

AllInterfaces returns all registered plugins' names

func (*Registry) Contains

func (r *Registry) Contains(name string) bool

Contains checks if the plugin's name is already registered

func (*Registry) Get

func (r *Registry) Get(name string) (Interface, bool)

Get returns a registered Interface, or nil if not

func (*Registry) InitAll

InitAll calls all registered plugins OnSync function

func (*Registry) Register

func (r *Registry) Register(name string, plugin Interface)

Register registers a Interface into registry by name. Register does not allow user to override an existing Interface. This is expected to happen during app startup

func (*Registry) RunAll

func (r *Registry) RunAll(stopCh <-chan struct{})

RunAll calls all registered plugins' Run function

func (*Registry) SyncAll

func (r *Registry) SyncAll(lb *lbapi.LoadBalancer)

SyncAll calls all registered plugins OnSync function

type RegistryBuilder

type RegistryBuilder []func(*Registry) error

RegistryBuilder collects functions that add things to a registry. It's to allow code to compile without explicitly referencing generated types. You should declare one in each package that will have generated deep copy or conversion functions.

func NewRegistryBuilder

func NewRegistryBuilder(funcs ...func(*Registry) error) RegistryBuilder

NewRegistryBuilder calls Register for you.

func (*RegistryBuilder) AddToRegistry

func (rb *RegistryBuilder) AddToRegistry(r *Registry) error

AddToRegistry applies all the stored functions to the registry. A non-nil error indicates that one function failed and the attempt was abandoned.

func (*RegistryBuilder) Register

func (rb *RegistryBuilder) Register(funcs ...func(*Registry) error)

Register adds a registry setup function to the list.

Jump to

Keyboard shortcuts

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