resources

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 10 Imported by: 99

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Kind

func Kind(resource Resource) string

func MetadataCompare added in v0.11.4

func MetadataCompare(metai, metaj *core.Metadata) int

func UpdateListMetadata

func UpdateListMetadata(resources ResourceList, updateFunc func(meta *core.Metadata))

func UpdateMetadata

func UpdateMetadata(resource Resource, updateFunc func(meta *core.Metadata))

func Validate

func Validate(resource Resource) error

func ValidateName

func ValidateName(name string) error

Types

type CloneableResource

type CloneableResource interface {
	Resource
	Clone() Resource
}

type CustomInputResource added in v0.13.9

type CustomInputResource interface {
	InputResource
	UnmarshalSpec(spec v1.Spec) error
	UnmarshalStatus(status v1.Status, defaultUnmarshaler StatusUnmarshaler)
	MarshalSpec() (v1.Spec, error)
	MarshalStatus() (v1.Status, error)
}

Custom resources imported in a solo-kit project can implement this interface to control how spec and status data is mapped to/from the generic `Resource` type.

type InputResource

type InputResource interface {
	Resource
	// Deprecated: prefer GetNamespacedStatuses()
	GetStatus() *core.Status
	// Deprecated: prefer SetNamespacedStatuses()
	SetStatus(status *core.Status)
	GetNamespacedStatuses() *core.NamespacedStatuses
	SetNamespacedStatuses(namespacedStatuses *core.NamespacedStatuses)
}

type InputResourceList

type InputResourceList []InputResource

func (InputResourceList) AsResourceList

func (list InputResourceList) AsResourceList() ResourceList

func (InputResourceList) Contains

func (list InputResourceList) Contains(list2 InputResourceList) bool

func (InputResourceList) Copy

func (InputResourceList) Equal

func (list InputResourceList) Equal(list2 InputResourceList) bool

func (InputResourceList) FilterByKind

func (list InputResourceList) FilterByKind(kind string) InputResourceList

func (InputResourceList) FilterByList

func (list InputResourceList) FilterByList(list2 InputResourceList) InputResourceList

func (InputResourceList) FilterByNames

func (list InputResourceList) FilterByNames(names []string) InputResourceList

func (InputResourceList) FilterByNamespaces

func (list InputResourceList) FilterByNamespaces(namespaces []string) InputResourceList

func (InputResourceList) Find

func (list InputResourceList) Find(namespace, name string) (InputResource, error)

func (InputResourceList) Len added in v0.11.4

func (list InputResourceList) Len() int

func (InputResourceList) Less added in v0.11.4

func (list InputResourceList) Less(i, j int) bool

func (InputResourceList) Names

func (list InputResourceList) Names() []string

func (InputResourceList) Namespaces

func (list InputResourceList) Namespaces() []string

func (InputResourceList) Swap added in v0.11.4

func (list InputResourceList) Swap(i, j int)

type InputResourcesByKind

type InputResourcesByKind map[string]InputResourceList

func (InputResourcesByKind) Add

func (m InputResourcesByKind) Add(resource InputResource)

func (InputResourcesByKind) Get

func (InputResourcesByKind) List

type ProtoResource

type ProtoResource interface {
	Resource
	proto.Message
}

func ProtoCast

func ProtoCast(res Resource) (ProtoResource, error)

type Resource

type Resource interface {
	GetMetadata() *core.Metadata
	SetMetadata(meta *core.Metadata)
	Equal(that interface{}) bool
}

func Clone

func Clone(resource Resource) Resource

type ResourceList

type ResourceList []Resource

func (ResourceList) AsInputResourceList

func (list ResourceList) AsInputResourceList() InputResourceList

func (ResourceList) ByCluster

func (list ResourceList) ByCluster() map[string]ResourceList

func (ResourceList) Contains

func (list ResourceList) Contains(list2 ResourceList) bool

func (ResourceList) Copy

func (list ResourceList) Copy() ResourceList

func (ResourceList) Each

func (list ResourceList) Each(do func(resource Resource))

func (ResourceList) EachErr

func (list ResourceList) EachErr(do func(resource Resource) error) error

func (ResourceList) Equal

func (list ResourceList) Equal(list2 ResourceList) bool

func (ResourceList) FilterByKind

func (list ResourceList) FilterByKind(kind string) ResourceList

func (ResourceList) FilterByList

func (list ResourceList) FilterByList(list2 ResourceList) ResourceList

func (ResourceList) FilterByNames

func (list ResourceList) FilterByNames(names []string) ResourceList

func (ResourceList) FilterByNamespaces

func (list ResourceList) FilterByNamespaces(namespaces []string) ResourceList

func (ResourceList) Find

func (list ResourceList) Find(namespace, name string) (Resource, error)

func (ResourceList) Len added in v0.11.4

func (list ResourceList) Len() int

func (ResourceList) Less added in v0.11.4

func (list ResourceList) Less(i, j int) bool

func (ResourceList) Names

func (list ResourceList) Names() []string

func (ResourceList) Namespaces

func (list ResourceList) Namespaces() []string

func (ResourceList) Sort

func (list ResourceList) Sort() ResourceList

func (ResourceList) Swap added in v0.11.4

func (list ResourceList) Swap(i, j int)

type ResourcesById

type ResourcesById map[string]Resource

func (ResourcesById) List

func (m ResourcesById) List() ResourceList

type ResourcesByKind

type ResourcesByKind map[string]ResourceList

func (ResourcesByKind) Add

func (m ResourcesByKind) Add(resources ...Resource)

func (ResourcesByKind) Get

func (m ResourcesByKind) Get(resource Resource) []Resource

func (ResourcesByKind) List

func (m ResourcesByKind) List() ResourceList

type StatusClient added in v0.23.0

type StatusClient interface {
	StatusGetter
	StatusSetter
}

type StatusGetter added in v0.23.0

type StatusGetter interface {
	GetStatus(resource InputResource) *core.Status
}

type StatusSetter added in v0.23.0

type StatusSetter interface {
	SetStatus(resource InputResource, status *core.Status)
}

type StatusUnmarshaler added in v0.23.0

type StatusUnmarshaler interface {
	UnmarshalStatus(status v1.Status, into InputResource)
}

type VersionedResource added in v0.10.4

type VersionedResource interface {
	Resource
	GroupVersionKind() schema.GroupVersionKind
}

Directories

Path Synopsis
common
kubernetes/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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