strategy

package
v0.0.0-...-8194725 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToListOpts

func ToListOpts(namespace string, opts storage.ListOptions) *kclient.ListOptions

Types

type CompleteCRUD

type CompleteCRUD interface {
	Lister
	Watcher
	Creater
	Updater
	Deleter
}

type CompleteStrategy

type CompleteStrategy interface {
	Creater
	Updater
	StatusUpdater
	Getter
	Lister
	Deleter
	Watcher

	Destroy()
	Scheme() *runtime.Scheme
}

type CreateAdapter

type CreateAdapter struct {
	names.NameGenerator
	*runtime.Scheme

	Warner            WarningsOnCreator
	Validator         Validator
	NameValidator     NameValidator
	PrepareForCreater PrepareForCreator
	// contains filtered or unexported fields
}

func NewCreate

func NewCreate(schema *runtime.Scheme, strategy Creater) *CreateAdapter

func (*CreateAdapter) Canonicalize

func (a *CreateAdapter) Canonicalize(obj runtime.Object)

func (*CreateAdapter) Create

func (a *CreateAdapter) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error)

func (*CreateAdapter) NamespaceScoped

func (a *CreateAdapter) NamespaceScoped() bool

func (*CreateAdapter) New

func (a *CreateAdapter) New() runtime.Object

func (*CreateAdapter) PrepareForCreate

func (a *CreateAdapter) PrepareForCreate(ctx context.Context, obj runtime.Object)

func (*CreateAdapter) Validate

func (a *CreateAdapter) Validate(ctx context.Context, obj runtime.Object) (result field.ErrorList)

func (*CreateAdapter) WarningsOnCreate

func (a *CreateAdapter) WarningsOnCreate(ctx context.Context, obj runtime.Object) []string

type Creater

type Creater interface {
	Create(ctx context.Context, object types.Object) (types.Object, error)
	New() types.Object
}

type DeleteAdapter

type DeleteAdapter struct {
	ValidateDeleter ValidateDeleter
	// contains filtered or unexported fields
}

func NewDelete

func NewDelete(scheme *runtime.Scheme, strategy Deleter) *DeleteAdapter

func (*DeleteAdapter) Delete

func (a *DeleteAdapter) Delete(ctx context.Context, name string, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions) (runtime.Object, bool, error)

func (*DeleteAdapter) ObjectKinds

func (a *DeleteAdapter) ObjectKinds(obj runtime.Object) ([]schema.GroupVersionKind, bool, error)

func (*DeleteAdapter) Recognizes

func (a *DeleteAdapter) Recognizes(gvk schema.GroupVersionKind) bool

type Deleter

type Deleter interface {
	Getter

	Delete(ctx context.Context, obj types.Object) (types.Object, error)
}

type DestroyAdapter

type DestroyAdapter struct {
	Destroyer Destroyer
}

func NewDestroyAdapter

func NewDestroyAdapter(destroy Destroyer) *DestroyAdapter

func (*DestroyAdapter) Destroy

func (d *DestroyAdapter) Destroy()

type Destroyer

type Destroyer interface {
	Destroy()
}

type GetAdapter

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

func NewGet

func NewGet(strategy Getter) *GetAdapter

func (*GetAdapter) Get

func (a *GetAdapter) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error)

type GetAttr

type GetAttr interface {
	GetAttr(obj runtime.Object) (labels.Set, fields.Set, error)
}

type GetToLister

type GetToLister interface {
	GetToList(ctx context.Context, namespace, name string) (types.ObjectList, error)
}

type Getter

type Getter interface {
	Get(ctx context.Context, namespace, name string) (types.Object, error)
}

type ListAdapter

type ListAdapter struct {
	*TableAdapter
	// contains filtered or unexported fields
}

func NewList

func NewList(strategy Lister) *ListAdapter

func (*ListAdapter) List

func (*ListAdapter) ListPredicate

ListPredicate returns a list of all the items matching the given SelectionPredicate.

func (*ListAdapter) NamespaceScoped

func (l *ListAdapter) NamespaceScoped() bool

func (*ListAdapter) NewList

func (l *ListAdapter) NewList() runtime.Object

type Lister

type Lister interface {
	List(ctx context.Context, namespace string, opts storage.ListOptions) (types.ObjectList, error)
	New() types.Object
	NewList() types.ObjectList
}

type NameValidator

type NameValidator interface {
	ValidateName(ctx context.Context, obj runtime.Object) field.ErrorList
}

type NamespaceScoper

type NamespaceScoper interface {
	NamespaceScoped() bool
}

type NewAdapter

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

func NewNew

func NewNew(n Newer) *NewAdapter

func (*NewAdapter) New

func (n *NewAdapter) New() runtime.Object

type Newer

type Newer interface {
	New() types.Object
}

type PrepareForCreator

type PrepareForCreator interface {
	PrepareForCreate(ctx context.Context, obj runtime.Object)
}

type PrepareForUpdater

type PrepareForUpdater interface {
	PrepareForUpdate(ctx context.Context, obj, old runtime.Object)
}

type Scoper

type Scoper interface {
	NamespaceScoped() bool
}

type ScoperAdapter

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

func NewScoper

func NewScoper(strategy Newer) *ScoperAdapter

func (*ScoperAdapter) NamespaceScoped

func (s *ScoperAdapter) NamespaceScoped() bool

type SingularNameAdapter

type SingularNameAdapter struct {
	Object runtime.Object
	Scheme *runtime.Scheme
}

func NewSingularNameAdapter

func NewSingularNameAdapter(obj runtime.Object, scheme *runtime.Scheme) *SingularNameAdapter

func (*SingularNameAdapter) GetSingularName

func (s *SingularNameAdapter) GetSingularName() string

type Status

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

func NewStatus

func NewStatus(scheme *runtime.Scheme, strategy StatusUpdater) *Status

func (*Status) ConvertToTable

func (s *Status) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error)

func (*Status) Destroy

func (s *Status) Destroy()

func (*Status) Get

func (s *Status) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error)

func (*Status) New

func (s *Status) New() runtime.Object

func (*Status) Update

func (s *Status) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error)

type StatusUpdater

type StatusUpdater interface {
	Getter
	Creater

	UpdateStatus(ctx context.Context, obj types.Object) (types.Object, error)
}

type TableAdapter

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

func NewTable

func NewTable(strategy any) *TableAdapter

func (*TableAdapter) ConvertToTable

func (t *TableAdapter) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error)

type UpdateAdapter

type UpdateAdapter struct {
	*CreateAdapter

	PrepareForUpdater PrepareForUpdater
	WarningsOnUpdater WarningsOnUpdater
	ValidateUpdater   ValidateUpdater
	// contains filtered or unexported fields
}

func NewUpdate

func NewUpdate(schema *runtime.Scheme, strategy Updater) *UpdateAdapter

func NewUpdateStatus

func NewUpdateStatus(schema *runtime.Scheme, strategy StatusUpdater) *UpdateAdapter

func (*UpdateAdapter) AllowCreateOnUpdate

func (a *UpdateAdapter) AllowCreateOnUpdate() bool

func (*UpdateAdapter) AllowUnconditionalUpdate

func (a *UpdateAdapter) AllowUnconditionalUpdate() bool

func (*UpdateAdapter) PrepareForUpdate

func (a *UpdateAdapter) PrepareForUpdate(ctx context.Context, obj, old runtime.Object)

func (*UpdateAdapter) Update

func (a *UpdateAdapter) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error)

func (*UpdateAdapter) ValidateUpdate

func (a *UpdateAdapter) ValidateUpdate(ctx context.Context, obj, old runtime.Object) (result field.ErrorList)

func (*UpdateAdapter) WarningsOnUpdate

func (a *UpdateAdapter) WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string

type Updater

type Updater interface {
	Getter
	Creater

	Update(ctx context.Context, obj types.Object) (types.Object, error)
}

type ValidateDeleter

type ValidateDeleter interface {
	ValidateDelete(ctx context.Context, obj runtime.Object) *apierror.StatusError
}

type ValidateUpdater

type ValidateUpdater interface {
	ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList
}

type Validator

type Validator interface {
	Validate(ctx context.Context, obj runtime.Object) field.ErrorList
}

type WarningsOnCreator

type WarningsOnCreator interface {
	WarningsOnCreate(ctx context.Context, obj runtime.Object) []string
}

type WarningsOnUpdater

type WarningsOnUpdater interface {
	WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string
}

type WatchAdapter

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

func NewWatch

func NewWatch(strategy Watcher) *WatchAdapter

func (*WatchAdapter) NamespaceScoped

func (w *WatchAdapter) NamespaceScoped() bool

func (*WatchAdapter) Watch

func (*WatchAdapter) WatchPredicate

func (w *WatchAdapter) WatchPredicate(ctx context.Context, p storage.SelectionPredicate, resourceVersion string) (watch.Interface, error)

type Watcher

type Watcher interface {
	Watch(ctx context.Context, namespace string, opts storage.ListOptions) (<-chan watch.Event, error)
	New() types.Object
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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