generic

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: Apache-2.0 Imports: 17 Imported by: 271

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSkip = errors2.New("skip processing")

Functions

func ToName added in v0.3.0

func ToName(h interface{}) string

Types

type Controller

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

Controller is the controller implementation for Foo resources

func NewController

func NewController(gvk schema.GroupVersionKind, informer cache.SharedIndexInformer, workqueue workqueue.RateLimitingInterface, handler Handler) *Controller

NewController returns a new sample controller

func (*Controller) Enqueue

func (c *Controller) Enqueue(namespace, name string)

func (*Controller) EnqueueAfter added in v0.3.0

func (c *Controller) EnqueueAfter(namespace, name string, duration time.Duration)

func (*Controller) GroupVersionKind added in v0.3.0

func (c *Controller) GroupVersionKind() schema.GroupVersionKind

func (*Controller) Informer added in v0.3.0

func (c *Controller) Informer() cache.SharedIndexInformer

func (*Controller) Run

func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error

type ControllerManager

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

func (*ControllerManager) AddHandler

func (g *ControllerManager) AddHandler(ctx context.Context, gvk schema.GroupVersionKind, informer cache.SharedIndexInformer, name string, handler Handler)

func (*ControllerManager) Controllers added in v0.3.0

func (g *ControllerManager) Controllers() map[schema.GroupVersionKind]*Controller

func (*ControllerManager) Enqueue

func (g *ControllerManager) Enqueue(gvk schema.GroupVersionKind, informer cache.SharedIndexInformer, namespace, name string)

func (*ControllerManager) EnqueueAfter added in v0.3.0

func (g *ControllerManager) EnqueueAfter(gvk schema.GroupVersionKind, informer cache.SharedIndexInformer, namespace, name string, duration time.Duration)

func (*ControllerManager) EnsureStart added in v0.3.0

func (g *ControllerManager) EnsureStart(ctx context.Context, gvk schema.GroupVersionKind, threadiness int) error

func (*ControllerManager) Start

func (g *ControllerManager) Start(ctx context.Context, defaultThreadiness int, threadiness map[schema.GroupVersionKind]int) error

type ControllerMeta added in v0.3.0

type ControllerMeta interface {
	Informer() cache.SharedIndexInformer
	GroupVersionKind() schema.GroupVersionKind

	AddGenericHandler(ctx context.Context, name string, handler Handler)
	AddGenericRemoveHandler(ctx context.Context, name string, handler Handler)
	Updater() Updater
}

type GeneratingHandlerOptions added in v0.3.0

type GeneratingHandlerOptions struct {
	AllowCrossNamespace bool
	AllowClusterScoped  bool
	DynamicLookup       bool
}

type Handler

type Handler func(key string, obj runtime.Object) (runtime.Object, error)

func NewRemoveHandler

func NewRemoveHandler(name string, updater Updater, handler Handler) Handler

type HandlerTransaction added in v0.5.0

type HandlerTransaction struct {
	context.Context
	// contains filtered or unexported fields
}

func NewHandlerTransaction added in v0.5.0

func NewHandlerTransaction(ctx context.Context) *HandlerTransaction

func (*HandlerTransaction) Commit added in v0.5.0

func (h *HandlerTransaction) Commit()

func (*HandlerTransaction) Rollback added in v0.5.0

func (h *HandlerTransaction) Rollback()

type Handlers

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

func (*Handlers) Handle

func (h *Handlers) Handle(key string, obj runtime.Object) (runtime.Object, error)

type Updater

type Updater func(runtime.Object) (runtime.Object, error)

Jump to

Keyboard shortcuts

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