runtime

package
v0.0.0-...-9cd5fb2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 31 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIgnore = errors.New("ignore handler error")
)

Functions

func CopyInto

func CopyInto(dst, src runtime.Object) error

Types

type Backend

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

func (Backend) Create

func (c Backend) Create(ctx context.Context, obj kclient.Object, opts ...kclient.CreateOption) error

func (Backend) Delete

func (c Backend) Delete(ctx context.Context, obj kclient.Object, opts ...kclient.DeleteOption) error

func (Backend) DeleteAllOf

func (c Backend) DeleteAllOf(ctx context.Context, obj kclient.Object, opts ...kclient.DeleteAllOfOption) error

func (*Backend) GVKForObject

func (b *Backend) GVKForObject(obj runtime.Object, scheme *runtime.Scheme) (schema.GroupVersionKind, error)

func (Backend) Get

func (c Backend) Get(ctx context.Context, key kclient.ObjectKey, obj kclient.Object, opts ...kclient.GetOption) error

func (*Backend) GetInformerForKind

func (b *Backend) GetInformerForKind(ctx context.Context, gvk schema.GroupVersionKind) (kcache.SharedIndexInformer, error)

func (*Backend) GroupVersionKindFor

func (b *Backend) GroupVersionKindFor(obj runtime.Object) (schema.GroupVersionKind, error)

func (*Backend) IndexField

func (b *Backend) IndexField(ctx context.Context, obj kclient.Object, field string, extractValue kclient.IndexerFunc) error

func (*Backend) IsObjectNamespaced

func (b *Backend) IsObjectNamespaced(obj runtime.Object) (bool, error)

func (Backend) List

func (c Backend) List(ctx context.Context, list kclient.ObjectList, opts ...kclient.ListOption) error

func (Backend) Patch

func (c Backend) Patch(ctx context.Context, obj kclient.Object, patch kclient.Patch, opts ...kclient.PatchOption) error

func (Backend) RESTMapper

func (c Backend) RESTMapper() meta.RESTMapper

func (Backend) Scheme

func (c Backend) Scheme() *runtime.Scheme

func (*Backend) Start

func (b *Backend) Start(ctx context.Context) (err error)

func (Backend) Status

func (c Backend) Status() kclient.StatusWriter

func (Backend) SubResource

func (c Backend) SubResource(subResource string) kclient.SubResourceClient

func (*Backend) Trigger

func (b *Backend) Trigger(gvk schema.GroupVersionKind, key string, delay time.Duration) error

func (Backend) Update

func (c Backend) Update(ctx context.Context, obj kclient.Object, opts ...kclient.UpdateOption) error

func (*Backend) Watch

func (b *Backend) Watch(ctx context.Context, gvk schema.GroupVersionKind, name string, cb backend.Callback) error

type Config

type Config struct {
	Rest      *rest.Config
	Namespace string
}

type Controller

type Controller interface {
	Enqueue(namespace, name string)
	EnqueueAfter(namespace, name string, delay time.Duration)
	EnqueueKey(key string)
	Cache() (cache.Cache, error)
	Start(ctx context.Context, workers int) error
}

func New

func New(gvk schema.GroupVersionKind, scheme *runtime.Scheme, cache cache.Cache, handler Handler, opts *Options) (Controller, error)

type Handler

type Handler interface {
	OnChange(key string, obj runtime.Object) error
}

type HandlerFunc

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

func (HandlerFunc) OnChange

func (h HandlerFunc) OnChange(key string, obj runtime.Object) error

type HandlerTransaction

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

func NewHandlerTransaction

func NewHandlerTransaction(ctx context.Context) *HandlerTransaction

func (*HandlerTransaction) Commit

func (h *HandlerTransaction) Commit()

func (*HandlerTransaction) Rollback

func (h *HandlerTransaction) Rollback()

type Options

type Options struct {
	RateLimiter workqueue.RateLimiter
}

type ResourceVersionGetter

type ResourceVersionGetter interface {
	GetResourceVersion() string
}

type Runtime

type Runtime struct {
	Backend *Backend
}

func NewRuntime

func NewRuntime(cfg *rest.Config, scheme *runtime.Scheme) (*Runtime, error)

func NewRuntimeForNamespace

func NewRuntimeForNamespace(cfg *rest.Config, namespace string, scheme *runtime.Scheme) (*Runtime, error)

func NewRuntimeWithConfig

func NewRuntimeWithConfig(cfg Config, scheme *runtime.Scheme) (*Runtime, error)

func NewRuntimeWithConfigs

func NewRuntimeWithConfigs(defaultConfig Config, apiGroupConfigs map[string]Config, scheme *runtime.Scheme) (*Runtime, error)

type SharedController

type SharedController interface {
	Controller

	RegisterHandler(ctx context.Context, name string, handler SharedControllerHandler) error
}

type SharedControllerFactory

type SharedControllerFactory interface {
	ForKind(gvk schema.GroupVersionKind) (SharedController, error)
	Start(ctx context.Context, workers int) error
}

type SharedControllerFactoryOptions

type SharedControllerFactoryOptions struct {
	DefaultRateLimiter workqueue.RateLimiter
	DefaultWorkers     int

	KindRateLimiter map[schema.GroupVersionKind]workqueue.RateLimiter
	KindWorkers     map[schema.GroupVersionKind]int
}

type SharedControllerHandler

type SharedControllerHandler interface {
	OnChange(key string, obj runtime.Object) (runtime.Object, error)
}

type SharedControllerHandlerFunc

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

func (SharedControllerHandlerFunc) OnChange

type SharedHandler

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

func (*SharedHandler) OnChange

func (h *SharedHandler) OnChange(key string, obj runtime.Object) error

func (*SharedHandler) Register

func (h *SharedHandler) Register(ctx context.Context, name string, handler SharedControllerHandler)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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