generic

package
v0.0.0-...-33a4775 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterObject

func FilterObject[S meta.Object](obj S, filters ...Filter[S]) bool

func WithModStatusGetter

func WithModStatusGetter[S meta.Object](gvk schema.GroupVersionKind, in func() ModClient[S]) func() ModStatusClient[S]

Types

type Action

type Action[S meta.Object] func(obj S) error

type ClientStatusGetter

type ClientStatusGetter[S meta.Object] func() ModStatusClient[S]

type CreateInterface

type CreateInterface[S meta.Object] interface {
	Create(ctx context.Context, obj S, opts meta.CreateOptions) (S, error)
}

type DeleteInterface

type DeleteInterface[S meta.Object] interface {
	Delete(ctx context.Context, name string, opts meta.DeleteOptions) error
}

type ExtractorList

type ExtractorList[L ListContinue, S meta.Object] func(in L) []S

type Filter

type Filter[S meta.Object] func(obj S) bool

func FilterByLabels

func FilterByLabels[S meta.Object](labels map[string]string) Filter[S]

type GetInterface

type GetInterface[S meta.Object] interface {
	Get(ctx context.Context, name string, opts meta.GetOptions) (S, error)
}

type Inspector

type Inspector[S meta.Object] interface {
	gvk.GVK

	ListSimple() []S
	GetSimple(name string) (S, bool)
	Filter(filters ...Filter[S]) []S
	Iterate(action Action[S], filters ...Filter[S]) error
	Read() ReadClient[S]
}

type InspectorInterface

type InspectorInterface[S meta.Object] interface {
	ModClient[S]
	ReadClient[S]
}

type InspectorStatusInterface

type InspectorStatusInterface[S meta.Object] interface {
	ModStatusClient[S]
	ReadClient[S]
}

type ListContinue

type ListContinue interface {
	GetContinue() string
}

type ListInterface

type ListInterface[S ListContinue] interface {
	List(ctx context.Context, opts meta.ListOptions) (S, error)
}

type ModClient

type ModClient[S meta.Object] interface {
	CreateInterface[S]
	UpdateInterface[S]
	PatchInterface[S]
	DeleteInterface[S]
}

func WithEmptyMod

func WithEmptyMod[S meta.Object](gvk schema.GroupVersionKind) ModClient[S]

type ModStatusClient

type ModStatusClient[S meta.Object] interface {
	ModClient[S]
	UpdateStatusInterface[S]
}

func NewModThrottle

func NewModThrottle[S meta.Object](component definitions.Component, componentGetter ThrottleGetter, clientStatus ClientStatusGetter[S]) ModStatusClient[S]

func WithModStatus

func WithModStatus[S meta.Object](gvk schema.GroupVersionKind, in ModClient[S]) ModStatusClient[S]

type PatchInterface

type PatchInterface[S meta.Object] interface {
	Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts meta.PatchOptions, subresources ...string) (result S, err error)
}

type ReadClient

type ReadClient[S meta.Object] interface {
	GetInterface[S]
}

type Scale

type Scale interface {
	ScaleGet
	ScaleUpdate
}

type ScaleGet

type ScaleGet interface {
	GetScale(ctx context.Context, name string, options meta.GetOptions) (*autoscaling.Scale, error)
}

type ScaleUpdate

type ScaleUpdate interface {
	UpdateScale(ctx context.Context, name string, scale *autoscaling.Scale, opts meta.UpdateOptions) (*autoscaling.Scale, error)
}

type ThrottleGetter

type ThrottleGetter func() throttle.Components

type UpdateInterface

type UpdateInterface[S meta.Object] interface {
	Update(ctx context.Context, obj S, opts meta.UpdateOptions) (S, error)
}

type UpdateStatusInterface

type UpdateStatusInterface[S meta.Object] interface {
	UpdateStatus(ctx context.Context, obj S, opts meta.UpdateOptions) (S, error)
}

Jump to

Keyboard shortcuts

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