state

package
v0.0.0-...-67cdcee Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InstancesIdentifier

type InstancesIdentifier struct {
	Basename   string
	ObjectKind string
	APIGroup   string
}

InstancesIdentifier is a unique identifier for object replicas group

type InstancesState

type InstancesState struct {
	DesiredReplicaCount int32
	CurrentReplicaCount int32
	Object              *api.Object
}

InstancesState represents state of object replicas.

type NamespacesState

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

NamespacesState represents state of all used namespaces.

func (*NamespacesState) Delete

func (ns *NamespacesState) Delete(namespace string, identifier InstancesIdentifier) error

Delete removes information about given instances. It there is no information for given object it is assumed that there are no object replicas.

func (*NamespacesState) Get

func (ns *NamespacesState) Get(namespace string, identifier InstancesIdentifier) (*InstancesState, bool)

Get returns state of object instances - number of existing replicas and its configuration.

func (*NamespacesState) Set

func (ns *NamespacesState) Set(namespace string, identifier InstancesIdentifier, instances *InstancesState)

Set stores information about object instances state to test state.

type ResourceTypeIdentifier

type ResourceTypeIdentifier struct {
	ObjectKind string
	APIGroup   string
}

ResourceTypeIdentifier is a unique identifier for a resource type.

type ResourcesVersionsState

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

ResourcesVersionsState represents most recent resources versions for a given object types. These versions are available only for resource types of objects that were create/updated by the clusterloader.

func (*ResourcesVersionsState) Get

Get returns state of current resource version.

func (*ResourcesVersionsState) Set

func (rs *ResourcesVersionsState) Set(identifier ResourceTypeIdentifier, resourceVersion string) error

Set stores information about current resource version.

type State

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

State is a state of the cluster. It is composed of namespaces state and resources versions state.

func NewState

func NewState() *State

NewState creates new State instance.

func (*State) GetNamespacesState

func (s *State) GetNamespacesState() *NamespacesState

GetNamespacesState returns namespaces state.

func (*State) GetResourcesVersionState

func (s *State) GetResourcesVersionState() *ResourcesVersionsState

GetResourcesVersionState returns resources versions state.

Jump to

Keyboard shortcuts

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