selectors

package
v0.18.0-rc.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLabels

func GetLabels(labels v1.Labels, sel ...LabelSelector) v1.Labels

func SelectLabels

func SelectLabels(labels v1.Labels, sel ...LabelSelector) ([]v1.Label, error)

func SelectReferences

SelectReferences select resources by a set of selectors. It requires to be called with a compdesc.References list.

func SelectResources

SelectResources select resources by a set of selectors. It requires to be called with a compdesc.Resources list.

func SelectSources

SelectSources select sources by a set of selectors. It requires to be called with a compdesc.Sources list.

func ValidateSelectors

func ValidateSelectors[T any](sel ...T) error

func ValidateSubSelectors

func ValidateSubSelectors[T any](msg string, sel ...T) error

func VersionConstraint

func VersionConstraint(expr string) *semverConstraint

Types

type ArtifactErrorSelectorImpl

type ArtifactErrorSelectorImpl struct {
	ErrorSelectorBase
	ArtifactSelectorImpl
}

func NewArtifactErrorSelectorImpl

func NewArtifactErrorSelectorImpl(s ArtifactSelector, err error) *ArtifactErrorSelectorImpl

type ArtifactSelector

type ArtifactSelector interface {
	MatchArtifact(a accessors.ArtifactAccessor) bool
}

type ArtifactSelectorImpl

type ArtifactSelectorImpl struct {
	ArtifactSelector
}

func AccessKind

func AccessKind(n string) *ArtifactSelectorImpl

func ArtifactType

func ArtifactType(n string) *ArtifactSelectorImpl

func (*ArtifactSelectorImpl) MatchResource

func (*ArtifactSelectorImpl) MatchSource

type ErrorProvider

type ErrorProvider interface {
	GetError() error
}

ErrorProvider is an optional interface a Selector can offer to propagate an error determined setting up the selector. Such an error cannot be returned directly by the function creating the selector, because this would prohibit to compose selector sets as variadic arguments.

type ErrorSelectorBase

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

func NewErrorSelectorBase

func NewErrorSelectorBase(err error) ErrorSelectorBase

func (*ErrorSelectorBase) GetError

func (s *ErrorSelectorBase) GetError() error

type IdentityErrorSelectorImpl

type IdentityErrorSelectorImpl struct {
	ErrorSelectorBase
	IdentitySelectorImpl
}

func NewIdentityErrorSelectorImpl

func NewIdentityErrorSelectorImpl(s IdentitySelector, err error) *IdentityErrorSelectorImpl

type IdentitySelector

type IdentitySelector interface {
	MatchIdentity(identity v1.Identity) bool
}

type IdentitySelectorImpl

type IdentitySelectorImpl struct {
	IdentitySelector
}

func ExtraIdentity added in v0.15.0

func ExtraIdentity(identity v1.Identity) *IdentitySelectorImpl

func ExtraIdentityByKeyPairs added in v0.15.0

func ExtraIdentityByKeyPairs(extra ...string) *IdentitySelectorImpl

func Identity

func Identity(identity v1.Identity) *IdentitySelectorImpl

func IdentityAttrRegex

func IdentityAttrRegex(name, ex string) *IdentitySelectorImpl

func IdentityAttributes

func IdentityAttributes(identity v1.Identity) *IdentitySelectorImpl

func IdentityAttributesByKeyPairs

func IdentityAttributesByKeyPairs(extra ...string) *IdentitySelectorImpl

func IdentityByKeyPairs

func IdentityByKeyPairs(name string, extra ...string) *IdentitySelectorImpl

func NumberOfIdentityAttributes

func NumberOfIdentityAttributes(n int) *IdentitySelectorImpl

func PartialIdentity added in v0.15.0

func PartialIdentity(identity v1.Identity) *IdentitySelectorImpl

func PartialIdentityByKeyPairs added in v0.15.0

func PartialIdentityByKeyPairs(attrs ...string) *IdentitySelectorImpl

func (*IdentitySelectorImpl) MatchReference

func (*IdentitySelectorImpl) MatchResource

func (*IdentitySelectorImpl) MatchSource

type LabelErrPropSelectorImpl

type LabelErrPropSelectorImpl struct {
	LabelSelectorImpl
}

func Label

func (*LabelErrPropSelectorImpl) GetError

func (l *LabelErrPropSelectorImpl) GetError() error

type LabelErrorSelectorImpl

type LabelErrorSelectorImpl struct {
	ErrorSelectorBase
	LabelSelectorImpl
}

func NewLabelErrorSelectorImpl

func NewLabelErrorSelectorImpl(s LabelSelector, err error) *LabelErrorSelectorImpl

type LabelSelector

type LabelSelector interface {
	MatchLabel(label *metav1.Label) bool
}

type LabelSelectorFunc

type LabelSelectorFunc func(label *metav1.Label) bool

func (LabelSelectorFunc) MatchLabel

func (f LabelSelectorFunc) MatchLabel(l *metav1.Label) bool

type LabelSelectorImpl

type LabelSelectorImpl struct {
	LabelSelector
}

func (*LabelSelectorImpl) MatchReference

func (*LabelSelectorImpl) MatchResource

func (*LabelSelectorImpl) MatchSource

type Name

type Name string

func (Name) MatchIdentity

func (n Name) MatchIdentity(identity v1.Identity) bool

func (Name) MatchReference

func (Name) MatchResource

func (Name) MatchSource

type ReferenceErrorSelectorImpl

type ReferenceErrorSelectorImpl struct {
	ErrorSelectorBase
	ReferenceSelector
}

func NewReferenceErrorSelectorImpl

func NewReferenceErrorSelectorImpl(s ReferenceSelector, err error) *ReferenceErrorSelectorImpl

type ReferenceSelector

type ReferenceSelector interface {
	MatchReference(accessors.ElementListAccessor, accessors.ReferenceAccessor) bool
}

type ResourceErrorSelectorImpl

type ResourceErrorSelectorImpl struct {
	ErrorSelectorBase
	ResourceSelector
}

func NewResourceErrorSelectorImpl

func NewResourceErrorSelectorImpl(s ResourceSelector, err error) *ResourceErrorSelectorImpl

type ResourceSelector

type ResourceSelector interface {
	MatchResource(accessors.ElementListAccessor, accessors.ResourceAccessor) bool
}

type ResourceSelectorFunc

type ResourceSelectorFunc func(accessors.ElementListAccessor, accessors.ResourceAccessor) bool

func (ResourceSelectorFunc) MatchResource

type SourceErrorSelectorImpl

type SourceErrorSelectorImpl struct {
	ErrorSelectorBase
	SourceSelector
}

func NewSourceErrorSelectorImpl

func NewSourceErrorSelectorImpl(s SourceSelector, err error) *SourceErrorSelectorImpl

type SourceSelector

type SourceSelector interface {
	MatchSource(accessors.ElementListAccessor, accessors.SourceAccessor) bool
}

type SourceSelectorFunc

type SourceSelectorFunc func(accessors.ElementListAccessor, accessors.SourceAccessor) bool

func (SourceSelectorFunc) MatchSource

type Version

type Version string

func (Version) MatchIdentity

func (v Version) MatchIdentity(identity v1.Identity) bool

func (Version) MatchReference

func (Version) MatchResource

func (Version) MatchSource

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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