watches

package
v0.2.1-0...-ae6be22 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConstraintFunction

type ConstraintFunction func(wctx WatchContext) bool

ConstraintFunction maps a check function to a constraint interface

func (ConstraintFunction) Check

func (this ConstraintFunction) Check(wctx WatchContext) bool

type FlavoredResource

type FlavoredResource []ResourceFlavor

FlavoredResource describe a sequence of potential Resource Flavors which is checked to determine the actual ressource key for a dedicated watch context. The first flavor yielding a result will be chosen.

func NewFlavoredResource

func NewFlavoredResource(flavors ...ResourceFlavor) FlavoredResource

func SimpleResourceFlavors

func SimpleResourceFlavors(group, kind string, constraints ...WatchConstraint) FlavoredResource

func SimpleResourceFlavorsByGK

func SimpleResourceFlavorsByGK(gk schema.GroupKind, constraints ...WatchConstraint) FlavoredResource

func SimpleResourceFlavorsByKey

func SimpleResourceFlavorsByKey(key ResourceKey, constraints ...WatchConstraint) FlavoredResource

func (FlavoredResource) RequestMinimalFor

func (this FlavoredResource) RequestMinimalFor(gk schema.GroupKind)

func (FlavoredResource) String

func (this FlavoredResource) String() string

func (FlavoredResource) WatchResourceDef

func (this FlavoredResource) WatchResourceDef(wctx WatchContext, def WatchResourceDef) WatchResourceDef

type ObjectSelector

type ObjectSelector func(wctx WatchContext) resources.ObjectName

func (ObjectSelector) RequestMinimalFor

func (ObjectSelector) RequestMinimalFor(_ schema.GroupKind)

func (ObjectSelector) String

func (this ObjectSelector) String() string

func (ObjectSelector) WatchResourceDef

func (this ObjectSelector) WatchResourceDef(wctx WatchContext, def WatchResourceDef) WatchResourceDef

type ResourceFlavor

type ResourceFlavor interface {
	WatchResourceDef(wctx WatchContext, def WatchResourceDef) WatchResourceDef
	RequestMinimalFor(gk schema.GroupKind)
	String() string
}

ResourceFlavor describes a dedicated flavor a resource If it matches a dedicated watch context a resource key is returned, nil otherwise

func Conditional

func Conditional(cond WatchConstraint, flavors ...ResourceFlavor) ResourceFlavor

Conditional decribes a resource flavor checked if a dedicated contraint is met.

func LocalNamespace

func LocalNamespace() ResourceFlavor

func LocalObjectByName

func LocalObjectByName(name string) ResourceFlavor

func Minimal

func Minimal() ResourceFlavor

func Namespace

func Namespace(namespace string) ResourceFlavor

func NamespaceByOption

func NamespaceByOption(opt string, srcnames ...string) ResourceFlavor

func NewResourceFlavor

func NewResourceFlavor(group, kind string, constraints ...WatchConstraint) ResourceFlavor

func ObjectByNameOption

func ObjectByNameOption(opt string, srcnames ...string) ResourceFlavor

func ResourceFlavorByGK

func ResourceFlavorByGK(gk schema.GroupKind, constraints ...WatchConstraint) ResourceFlavor

type ResourceKey

type ResourceKey = extension.ResourceKey

ResourceKey implementations are used as key and MUST therefore be value types

type WatchConstraint

type WatchConstraint interface {
	Check(ctx WatchContext) bool
}

WatchConstraint is a match check for a dedicated watch context

func APIServerVersion

func APIServerVersion(constraint string) WatchConstraint

APIServerVersion checks for a version constraint for the api server

func And

And checks multiple constraints to be true

func FlagOption

func FlagOption(name string) WatchConstraint

FlagOption check a bool option to be set

func NewFunctionWatchConstraint

func NewFunctionWatchConstraint(f ConstraintFunction, desc string) WatchConstraint

NewFunctionWatchConstraint creates a watch constraint using a `ConstraintFunction`

func Not

Not negates a constraint

func Or

Or checks multiple constraints to be not false

func StringOption

func StringOption(name string, values ...string) WatchConstraint

type WatchContext

type WatchContext interface {
	Name() string
	extension.ElementOptions
	Cluster() cluster.Interface
	GetCluster(name string) cluster.Interface
	Namespace() string
}

WatchContext describes the context to evaluate a resource key for

type WatchResourceDef

type WatchResourceDef struct {
	Key       ResourceKey
	Namespace string
	Tweaker   []resources.TweakListOptionsFunc
	Minimal   bool
}

type WatchTweaker

type WatchTweaker func(wxtc WatchContext) resources.TweakListOptionsFunc

func (WatchTweaker) RequestMinimalFor

func (WatchTweaker) RequestMinimalFor(_ schema.GroupKind)

func (WatchTweaker) String

func (this WatchTweaker) String() string

func (WatchTweaker) WatchResourceDef

func (this WatchTweaker) WatchResourceDef(wctx WatchContext, def WatchResourceDef) WatchResourceDef

Jump to

Keyboard shortcuts

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