abstract

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: Apache-2.0, MIT Imports: 18 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeclareDefaultVersion

func DeclareDefaultVersion(gv schema.GroupVersion)

func DefaultScheme

func DefaultScheme() *runtime.Scheme

func DefaultVersion

func DefaultVersion(g string) string

func EqualsClusterObjectKey

func EqualsClusterObjectKey(a, b ClusterObjectKey) bool

func EqualsObjectKey

func EqualsObjectKey(a, b ObjectKey) bool

func EqualsObjectName

func EqualsObjectName(a, b ObjectName) bool

func Everything

func Everything() labels.Selector

func NewGroupKind

func NewGroupKind(group, kind string) schema.GroupKind

func Register

func Register(builders ...runtime.SchemeBuilder)

Types

type AbstractObject

type AbstractObject struct {
	ObjectData
	// contains filtered or unexported fields
}

func NewAbstractObject

func NewAbstractObject(data ObjectData, resource Resource) *AbstractObject

func (*AbstractObject) Data

func (this *AbstractObject) Data() ObjectData

func (*AbstractObject) Description

func (this *AbstractObject) Description() string

func (*AbstractObject) GetAnnotation

func (this *AbstractObject) GetAnnotation(name string) string

func (*AbstractObject) GetLabel

func (this *AbstractObject) GetLabel(name string) string

func (*AbstractObject) GetOwnerReference

func (this *AbstractObject) GetOwnerReference() *metav1.OwnerReference

func (*AbstractObject) GetResource

func (this *AbstractObject) GetResource() Resource

func (*AbstractObject) GroupKind

func (this *AbstractObject) GroupKind() schema.GroupKind

func (*AbstractObject) GroupVersionKind

func (this *AbstractObject) GroupVersionKind() schema.GroupVersionKind

func (*AbstractObject) HasFinalizer

func (this *AbstractObject) HasFinalizer(key string) bool

func (*AbstractObject) IsA

func (this *AbstractObject) IsA(spec interface{}) bool

func (*AbstractObject) IsDeleting

func (this *AbstractObject) IsDeleting() bool

func (*AbstractObject) Key

func (this *AbstractObject) Key() ObjectKey

func (*AbstractObject) ObjectName

func (this *AbstractObject) ObjectName() ObjectName

func (*AbstractObject) RemoveFinalizer

func (this *AbstractObject) RemoveFinalizer(key string) error

func (*AbstractObject) SetFinalizer

func (this *AbstractObject) SetFinalizer(key string) error

func (*AbstractObject) Status

func (this *AbstractObject) Status() interface{}

type AbstractResource

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

func NewAbstractResource

func NewAbstractResource(
	context ResourceContext,
	otype reflect.Type,
	ltype reflect.Type,
	gvk schema.GroupVersionKind) *AbstractResource

func (*AbstractResource) CheckOType

func (this *AbstractResource) CheckOType(obj ObjectData, unstructured ...bool) error

func (*AbstractResource) CreateData

func (this *AbstractResource) CreateData(name ...ObjectDataName) ObjectData

func (*AbstractResource) CreateListData

func (this *AbstractResource) CreateListData() runtime.Object

func (*AbstractResource) GroupKind

func (this *AbstractResource) GroupKind() schema.GroupKind

func (*AbstractResource) GroupVersionKind

func (this *AbstractResource) GroupVersionKind() schema.GroupVersionKind

func (*AbstractResource) IsUnstructured

func (this *AbstractResource) IsUnstructured() bool

func (*AbstractResource) ListType

func (this *AbstractResource) ListType() reflect.Type

func (*AbstractResource) New

func (this *AbstractResource) New(name ObjectName) ObjectData

func (*AbstractResource) ObjectType

func (this *AbstractResource) ObjectType() reflect.Type

func (*AbstractResource) ResourceContext

func (this *AbstractResource) ResourceContext() ResourceContext

type AbstractResourceContext

type AbstractResourceContext struct {
	context.Context
	// contains filtered or unexported fields
}

func NewAbstractResourceContext

func NewAbstractResourceContext(ctx context.Context, self ResourceContext, scheme *runtime.Scheme, factory Factory) *AbstractResourceContext

func (*AbstractResourceContext) Decoder

func (this *AbstractResourceContext) Decoder() *Decoder

func (*AbstractResourceContext) GetGVK

func (*AbstractResourceContext) GetGVKForGK

func (*AbstractResourceContext) GetGroups

func (this *AbstractResourceContext) GetGroups() []schema.GroupVersion

func (*AbstractResourceContext) KnownTypes

func (*AbstractResourceContext) Lock

func (this *AbstractResourceContext) Lock()

func (*AbstractResourceContext) ObjectKinds

func (*AbstractResourceContext) Resources

func (this *AbstractResourceContext) Resources() Resources

func (*AbstractResourceContext) Scheme

func (this *AbstractResourceContext) Scheme() *runtime.Scheme

func (*AbstractResourceContext) Unlock

func (this *AbstractResourceContext) Unlock()

type AbstractResources

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

func NewAbstractResources

func NewAbstractResources(ctx ResourceContext, self Resources, factory Factory) *AbstractResources

func (*AbstractResources) Decode

func (this *AbstractResources) Decode(bytes []byte) (ObjectData, error)

func (*AbstractResources) Get

func (this *AbstractResources) Get(spec interface{}) (Resource, error)

func (*AbstractResources) GetByExample

func (this *AbstractResources) GetByExample(obj runtime.Object) (Resource, error)

func (*AbstractResources) GetByGK

func (this *AbstractResources) GetByGK(gk schema.GroupKind) (Resource, error)

func (*AbstractResources) GetByGVK

func (this *AbstractResources) GetByGVK(gvk schema.GroupVersionKind) (Resource, error)

func (*AbstractResources) GetUnstructured

func (this *AbstractResources) GetUnstructured(spec interface{}) (Resource, error)

func (*AbstractResources) GetUnstructuredByGK

func (this *AbstractResources) GetUnstructuredByGK(gk schema.GroupKind) (Resource, error)

func (*AbstractResources) GetUnstructuredByGVK

func (this *AbstractResources) GetUnstructuredByGVK(gvk schema.GroupVersionKind) (Resource, error)

func (*AbstractResources) Lock

func (this *AbstractResources) Lock()

func (*AbstractResources) ResourceContext

func (this *AbstractResources) ResourceContext() ResourceContext

func (*AbstractResources) Scheme

func (this *AbstractResources) Scheme() *runtime.Scheme

func (*AbstractResources) Unlock

func (this *AbstractResources) Unlock()

type ClusterGroupKind

type ClusterGroupKind struct {
	Cluster string
	schema.GroupKind
}

func NewClusterGroupKind

func NewClusterGroupKind(cluster string, gk schema.GroupKind) ClusterGroupKind

func (ClusterGroupKind) Empty

func (cgk ClusterGroupKind) Empty() bool

func (ClusterGroupKind) String

func (cgk ClusterGroupKind) String() string

type ClusterGroupKindSet

type ClusterGroupKindSet map[ClusterGroupKind]struct{}

func NewClusterGroupKindSet

func NewClusterGroupKindSet(a ...ClusterGroupKind) ClusterGroupKindSet

func NewClusterGroupKindSetByArray

func NewClusterGroupKindSetByArray(a []ClusterGroupKind) ClusterGroupKindSet

func NewClusterGroupKindSetBySets

func NewClusterGroupKindSetBySets(sets ...ClusterGroupKindSet) ClusterGroupKindSet

func (ClusterGroupKindSet) Add

func (ClusterGroupKindSet) AddAll

func (ClusterGroupKindSet) AddSet

func (ClusterGroupKindSet) AsArray

func (this ClusterGroupKindSet) AsArray() []ClusterGroupKind

func (ClusterGroupKindSet) Contains

func (this ClusterGroupKindSet) Contains(n ClusterGroupKind) bool

func (ClusterGroupKindSet) Copy

func (ClusterGroupKindSet) DiffFrom

func (this ClusterGroupKindSet) DiffFrom(set ClusterGroupKindSet) (add, del ClusterGroupKindSet)

func (ClusterGroupKindSet) Equals

func (this ClusterGroupKindSet) Equals(set ClusterGroupKindSet) bool

func (ClusterGroupKindSet) Remove

func (ClusterGroupKindSet) String

func (this ClusterGroupKindSet) String() string

type ClusterObjectKey

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

func NewClusterKey

func NewClusterKey(cluster string, groupKind schema.GroupKind, namespace, name string) ClusterObjectKey

func NewClusterKeyForObject

func NewClusterKeyForObject(cluster string, key ObjectKey) ClusterObjectKey

func ParseClusterObjectKey

func ParseClusterObjectKey(clusterid string, key string) (ClusterObjectKey, error)

func (ClusterObjectKey) AsRefFor

func (this ClusterObjectKey) AsRefFor(clusterid string) string

func (ClusterObjectKey) Cluster

func (this ClusterObjectKey) Cluster() string

func (ClusterObjectKey) ClusterGroupKind

func (this ClusterObjectKey) ClusterGroupKind() ClusterGroupKind

func (ClusterObjectKey) ObjectKey

func (this ClusterObjectKey) ObjectKey() ObjectKey

func (ClusterObjectKey) String

func (this ClusterObjectKey) String() string

type ClusterObjectKeySet

type ClusterObjectKeySet map[ClusterObjectKey]struct{}

func NewClusterObjectKeSetBySets

func NewClusterObjectKeSetBySets(sets ...ClusterObjectKeySet) ClusterObjectKeySet

func NewClusterObjectKeySet

func NewClusterObjectKeySet(a ...ClusterObjectKey) ClusterObjectKeySet

func NewClusterObjectKeySetByArray

func NewClusterObjectKeySetByArray(a []ClusterObjectKey) ClusterObjectKeySet

func (ClusterObjectKeySet) Add

func (ClusterObjectKeySet) AddAll

func (ClusterObjectKeySet) AddSet

func (ClusterObjectKeySet) AsArray

func (this ClusterObjectKeySet) AsArray() []ClusterObjectKey

func (ClusterObjectKeySet) Contains

func (this ClusterObjectKeySet) Contains(n ClusterObjectKey) bool

func (ClusterObjectKeySet) Copy

func (ClusterObjectKeySet) DiffFrom

func (this ClusterObjectKeySet) DiffFrom(set ClusterObjectKeySet) (add, del ClusterObjectKeySet)

func (ClusterObjectKeySet) Equals

func (this ClusterObjectKeySet) Equals(set ClusterObjectKeySet) bool

func (ClusterObjectKeySet) Remove

func (ClusterObjectKeySet) String

func (this ClusterObjectKeySet) String() string

type Decoder

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

func NewDecoder

func NewDecoder(scheme *runtime.Scheme) *Decoder

func (*Decoder) Decode

func (this *Decoder) Decode(bytes []byte) (runtime.Object, *schema.GroupVersionKind, error)

func (*Decoder) DecodeInto

func (this *Decoder) DecodeInto(bytes []byte, into runtime.Object) error

type Factory

type Factory interface {
	NewResources(ResourceContext, Factory) Resources
	NewResource(resources Resources, gvk schema.GroupVersionKind, otype, ltype reflect.Type) (Resource, error)
	ResolveGVK(ResourceContext, schema.GroupKind, []schema.GroupVersionKind) (schema.GroupVersionKind, error)
}

type GenericObjectName

type GenericObjectName interface {
	ObjectName
	ObjectDataName
}

func NewObjectName

func NewObjectName(names ...string) GenericObjectName

func NewObjectNameForData

func NewObjectNameForData(p ObjectDataName) GenericObjectName

func ParseObjectName

func ParseObjectName(name string) (GenericObjectName, error)

type GroupKindProvider

type GroupKindProvider interface {
	GroupKind() schema.GroupKind
}

type GroupKindSet

type GroupKindSet map[schema.GroupKind]struct{}

func NewGroupKindSet

func NewGroupKindSet(a ...schema.GroupKind) GroupKindSet

func NewGroupKindSetByArray

func NewGroupKindSetByArray(a []schema.GroupKind) GroupKindSet

func NewGroupKindSetBySets

func NewGroupKindSetBySets(sets ...GroupKindSet) GroupKindSet

func (GroupKindSet) Add

func (this GroupKindSet) Add(n ...schema.GroupKind) GroupKindSet

func (GroupKindSet) AddAll

func (this GroupKindSet) AddAll(n []schema.GroupKind) GroupKindSet

func (GroupKindSet) AddSet

func (this GroupKindSet) AddSet(sets ...GroupKindSet) GroupKindSet

func (GroupKindSet) AsArray

func (this GroupKindSet) AsArray() []schema.GroupKind

func (GroupKindSet) Contains

func (this GroupKindSet) Contains(n schema.GroupKind) bool

func (GroupKindSet) Copy

func (this GroupKindSet) Copy() GroupKindSet

func (GroupKindSet) DiffFrom

func (this GroupKindSet) DiffFrom(set GroupKindSet) (add, del GroupKindSet)

func (GroupKindSet) Equals

func (this GroupKindSet) Equals(set GroupKindSet) bool

func (GroupKindSet) Remove

func (this GroupKindSet) Remove(n schema.GroupKind) GroupKindSet

func (GroupKindSet) String

func (this GroupKindSet) String() string

type GroupVersionKindProvider

type GroupVersionKindProvider interface {
	GroupVersionKind() schema.GroupVersionKind
}

type ModificationState

type ModificationState struct {
	utils.ModificationState
	// contains filtered or unexported fields
}

func NewModificationState

func NewModificationState(object Object, mod ...bool) *ModificationState

func (*ModificationState) Apply

func (this *ModificationState) Apply(f func(obj Object) bool) *ModificationState

func (*ModificationState) AssureLabel

func (this *ModificationState) AssureLabel(name, value string) *ModificationState

func (*ModificationState) Condition

func (*ModificationState) Conditions

func (*ModificationState) Data

func (this *ModificationState) Data() ObjectData

func (*ModificationState) Get

func (this *ModificationState) Get(field fieldpath.Field) (interface{}, error)

func (*ModificationState) Object

func (this *ModificationState) Object() Object

func (*ModificationState) Set

func (this *ModificationState) Set(field fieldpath.Field, value interface{}) error

type NewResource

type NewResource func(resources Resources, gvk schema.GroupVersionKind, otype reflect.Type, ltype reflect.Type) (Resource, error)

type Object

type Object interface {
	metav1.Object
	GroupKindProvider

	GroupVersionKind() schema.GroupVersionKind
	ObjectName() ObjectName
	Data() ObjectData
	Status() interface{}
	Key() ObjectKey

	IsA(spec interface{}) bool

	Description() string
	HasFinalizer(key string) bool
	SetFinalizer(key string) error
	RemoveFinalizer(key string) error

	GetLabel(name string) string
	GetAnnotation(name string) string

	IsDeleting() bool

	GetOwnerReference() *metav1.OwnerReference
}

type ObjectData

type ObjectData interface {
	metav1.Object
	runtime.Object
}

type ObjectDataName

type ObjectDataName interface {
	GetName() string
	GetNamespace() string
}

type ObjectKey

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

ObjectKey used for worker queues.

func NewKey

func NewKey(groupKind schema.GroupKind, namespace, name string) ObjectKey

func NewKeyForData

func NewKeyForData(data ObjectData) ObjectKey

func (ObjectKey) ForCluster

func (this ObjectKey) ForCluster(id string) ClusterObjectKey

func (ObjectKey) Group

func (this ObjectKey) Group() string

func (ObjectKey) GroupKind

func (this ObjectKey) GroupKind() schema.GroupKind

func (ObjectKey) Kind

func (this ObjectKey) Kind() string

func (ObjectKey) Name

func (this ObjectKey) Name() string

func (ObjectKey) Namespace

func (this ObjectKey) Namespace() string

func (ObjectKey) ObjectName

func (this ObjectKey) ObjectName() ObjectName

func (ObjectKey) String

func (this ObjectKey) String() string

type ObjectMatcher

type ObjectMatcher func(Object) bool

type ObjectName

type ObjectName interface {
	ObjectNameProvider

	ForGroupKind(gk schema.GroupKind) ObjectKey
	String() string
}

type ObjectNameProvider

type ObjectNameProvider interface {
	Namespace() string
	Name() string
}

type ObjectNameSet

type ObjectNameSet map[ObjectName]struct{}

func NewObjectNameSet

func NewObjectNameSet(a ...ObjectName) ObjectNameSet

func NewObjectNameSetByArray

func NewObjectNameSetByArray(a []ObjectName) ObjectNameSet

func NewObjectNameSetBySets

func NewObjectNameSetBySets(sets ...ObjectNameSet) ObjectNameSet

func (ObjectNameSet) Add

func (this ObjectNameSet) Add(n ...ObjectName) ObjectNameSet

func (ObjectNameSet) AddAll

func (this ObjectNameSet) AddAll(n []ObjectName) ObjectNameSet

func (ObjectNameSet) AddAllSplitted

func (this ObjectNameSet) AddAllSplitted(n string) (ObjectNameSet, error)

func (ObjectNameSet) AddSet

func (this ObjectNameSet) AddSet(sets ...ObjectNameSet) ObjectNameSet

func (ObjectNameSet) AsArray

func (this ObjectNameSet) AsArray() []ObjectName

func (ObjectNameSet) Contains

func (this ObjectNameSet) Contains(n ObjectName) bool

func (ObjectNameSet) Copy

func (this ObjectNameSet) Copy() ObjectNameSet

func (ObjectNameSet) DiffFrom

func (this ObjectNameSet) DiffFrom(set ObjectNameSet) (add, del ObjectNameSet)

func (ObjectNameSet) Equals

func (this ObjectNameSet) Equals(set ObjectNameSet) bool

func (ObjectNameSet) Remove

func (this ObjectNameSet) Remove(n ObjectName) ObjectNameSet

func (ObjectNameSet) String

func (this ObjectNameSet) String() string

type Resource

type Resource interface {
	GroupKindProvider
	GroupVersionKind() schema.GroupVersionKind

	ObjectType() reflect.Type
	ListType() reflect.Type
}

type ResourceContext

type ResourceContext interface {
	context.Context

	Scheme() *runtime.Scheme
	Decoder() *Decoder

	ObjectKinds(obj runtime.Object) ([]schema.GroupVersionKind, bool, error)
	KnownTypes(gv schema.GroupVersion) map[string]reflect.Type

	GetGroups() []schema.GroupVersion
	GetGVK(obj runtime.Object) (schema.GroupVersionKind, error)
	GetGVKForGK(gk schema.GroupKind) (schema.GroupVersionKind, error)
}

type Resources

type Resources interface {
	Scheme() *runtime.Scheme
}

Jump to

Keyboard shortcuts

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