controller

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter interface {
	Add(obj v1.Object) bool
	Update(oldObj, newObj v1.Object) bool
	Delete(obj v1.Object) bool
}

type FilterFuncs

type FilterFuncs struct {
	ParentFunc ParentFunc
	AddFunc    func(obj v1.Object) bool
	UpdateFunc func(oldObj, newObj v1.Object) bool
	DeleteFunc func(obj v1.Object) bool
}

func (FilterFuncs) Add

func (f FilterFuncs) Add(obj v1.Object) bool

func (FilterFuncs) Delete

func (f FilterFuncs) Delete(obj v1.Object) bool

func (FilterFuncs) Parent

func (f FilterFuncs) Parent(obj v1.Object) (namespace, name string)

func (FilterFuncs) Update

func (f FilterFuncs) Update(oldObj, newObj v1.Object) bool

type InformerGetter

type InformerGetter interface {
	Informer() cache.SharedIndexInformer
}

type KeySyncer

type KeySyncer interface {
	Key(namespace, name string) (v1.Object, error)
	Syncer
}

type Option

type Option func(*controller)

func WithInformer

func WithInformer(getter InformerGetter, filter ParentFilter) Option

func WithInformerSynced

func WithInformerSynced(getter InformerGetter) Option

func WithMaxRetries

func WithMaxRetries(maxRetries int) Option

func WithRateLimiter

func WithRateLimiter(limiter workqueue.RateLimiter) Option

type ParentFilter

type ParentFilter interface {
	Parent(obj v1.Object) (namespace, name string)
	Filter
}

func FilterByNames

func FilterByNames(parentFunc ParentFunc, names ...string) ParentFilter

type ParentFunc

type ParentFunc func(obj v1.Object) (namespace, name string)

type Runner

type Runner interface {
	Run(workers int, stopCh <-chan struct{})
}

func New

func New(name string, sync KeySyncer, opts ...Option) Runner

type SyncFunc

type SyncFunc func(v1.Object) error

type Syncer

type Syncer interface {
	Sync(v1.Object) error
}

Jump to

Keyboard shortcuts

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