Documentation
¶
Index ¶
- type ConstraintFunction
- type FlavoredResource
- func NewFlavoredResource(flavors ...ResourceFlavor) FlavoredResource
- func SimpleResourceFlavors(group, kind string, constraints ...WatchConstraint) FlavoredResource
- func SimpleResourceFlavorsByGK(gk schema.GroupKind, constraints ...WatchConstraint) FlavoredResource
- func SimpleResourceFlavorsByKey(key ResourceKey, constraints ...WatchConstraint) FlavoredResource
- type ObjectSelector
- type ResourceFlavor
- func Conditional(cond WatchConstraint, flavors ...ResourceFlavor) ResourceFlavor
- func LocalNamespace() ResourceFlavor
- func LocalObjectByName(name string) ResourceFlavor
- func Minimal() ResourceFlavor
- func Namespace(namespace string) ResourceFlavor
- func NamespaceByOption(opt string, srcnames ...string) ResourceFlavor
- func NewResourceFlavor(group, kind string, constraints ...WatchConstraint) ResourceFlavor
- func ObjectByNameOption(opt string, srcnames ...string) ResourceFlavor
- func ResourceFlavorByGK(gk schema.GroupKind, constraints ...WatchConstraint) ResourceFlavor
- type ResourceKey
- type WatchConstraint
- func APIServerVersion(constraint string) WatchConstraint
- func And(c ...WatchConstraint) WatchConstraint
- func FlagOption(name string) WatchConstraint
- func NewFunctionWatchConstraint(f ConstraintFunction, desc string) WatchConstraint
- func Not(c WatchConstraint) WatchConstraint
- func Or(c ...WatchConstraint) WatchConstraint
- func StringOption(name string, values ...string) WatchConstraint
- type WatchContext
- type WatchResourceDef
- type WatchTweaker
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 ¶
func And(c ...WatchConstraint) WatchConstraint
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 Or ¶
func Or(c ...WatchConstraint) WatchConstraint
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