statestore

package
v0.0.0-...-9d45c48 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

View Source
const (
	AttributeNameRequiredReplicas      = "required replicas"
	AttributeNameStatus                = "status"
	AttributeNameConditionTarget       = "condition target"
	AttributeNameConditionCurrentValue = "condition current value"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AbsenceTaskConditionFn

type AbsenceTaskConditionFn func(taskState *AbsenceTaskState) bool

type AbsenceTaskState

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

func NewAbsenceTaskState

func NewAbsenceTaskState(name, namespace string, groupVersionKind schema.GroupVersionKind, opts AbsenceTaskStateOptions) *AbsenceTaskState

func (*AbsenceTaskState) GroupVersionKind

func (s *AbsenceTaskState) GroupVersionKind() schema.GroupVersionKind

func (*AbsenceTaskState) Name

func (s *AbsenceTaskState) Name() string

func (*AbsenceTaskState) Namespace

func (s *AbsenceTaskState) Namespace() string

func (*AbsenceTaskState) ResourceState

func (s *AbsenceTaskState) ResourceState() *util.Concurrent[*ResourceState]

func (*AbsenceTaskState) SetStatus

func (s *AbsenceTaskState) SetStatus(status AbsenceTaskStatus)

func (*AbsenceTaskState) Status

func (s *AbsenceTaskState) Status() AbsenceTaskStatus

func (*AbsenceTaskState) UUID

func (s *AbsenceTaskState) UUID() string

type AbsenceTaskStateOptions

type AbsenceTaskStateOptions struct{}

type AbsenceTaskStatus

type AbsenceTaskStatus string
const (
	AbsenceTaskStatusProgressing AbsenceTaskStatus = "progressing"
	AbsenceTaskStatusAbsent      AbsenceTaskStatus = "absent"
	AbsenceTaskStatusFailed      AbsenceTaskStatus = "failed"
)

type Attribute

type Attribute[T int | string] struct {
	Value T
	// contains filtered or unexported fields
}

func NewAttribute

func NewAttribute[T int | string](name string, value T) *Attribute[T]

func (*Attribute[T]) Name

func (a *Attribute[T]) Name() string

type Attributer

type Attributer interface {
	Name() string
}

type Error

type Error struct {
	Time time.Time
	Err  error
}

type Event

type Event struct {
	Time    time.Time
	Message string
}

type PresenceTaskConditionFn

type PresenceTaskConditionFn func(taskState *PresenceTaskState) bool

type PresenceTaskState

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

func NewPresenceTaskState

func NewPresenceTaskState(name, namespace string, groupVersionKind schema.GroupVersionKind, opts PresenceTaskStateOptions) *PresenceTaskState

func (*PresenceTaskState) GroupVersionKind

func (s *PresenceTaskState) GroupVersionKind() schema.GroupVersionKind

func (*PresenceTaskState) Name

func (s *PresenceTaskState) Name() string

func (*PresenceTaskState) Namespace

func (s *PresenceTaskState) Namespace() string

func (*PresenceTaskState) ResourceState

func (s *PresenceTaskState) ResourceState() *util.Concurrent[*ResourceState]

func (*PresenceTaskState) SetStatus

func (s *PresenceTaskState) SetStatus(status PresenceTaskStatus)

func (*PresenceTaskState) Status

func (*PresenceTaskState) UUID

func (s *PresenceTaskState) UUID() string

type PresenceTaskStateOptions

type PresenceTaskStateOptions struct{}

type PresenceTaskStatus

type PresenceTaskStatus string
const (
	PresenceTaskStatusProgressing PresenceTaskStatus = "progressing"
	PresenceTaskStatusPresent     PresenceTaskStatus = "present"
	PresenceTaskStatusFailed      PresenceTaskStatus = "failed"
)

type ReadinessTaskConditionFn

type ReadinessTaskConditionFn func(taskState *ReadinessTaskState) bool

type ReadinessTaskState

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

func NewReadinessTaskState

func NewReadinessTaskState(name, namespace string, groupVersionKind schema.GroupVersionKind, opts ReadinessTaskStateOptions) *ReadinessTaskState

func (*ReadinessTaskState) AddDependency

func (s *ReadinessTaskState) AddDependency(fromName, fromNamespace string, fromGroupVersionKind schema.GroupVersionKind, toName, toNamespace string, toGroupVersionKind schema.GroupVersionKind)

func (*ReadinessTaskState) AddResourceState

func (s *ReadinessTaskState) AddResourceState(name, namespace string, groupVersionKind schema.GroupVersionKind)

func (*ReadinessTaskState) GroupVersionKind

func (s *ReadinessTaskState) GroupVersionKind() schema.GroupVersionKind

func (*ReadinessTaskState) Name

func (s *ReadinessTaskState) Name() string

func (*ReadinessTaskState) Namespace

func (s *ReadinessTaskState) Namespace() string

func (*ReadinessTaskState) ResourceState

func (s *ReadinessTaskState) ResourceState(name, namespace string, groupVersionKind schema.GroupVersionKind) *util.Concurrent[*ResourceState]

func (*ReadinessTaskState) ResourceStates

func (s *ReadinessTaskState) ResourceStates() []*util.Concurrent[*ResourceState]

func (*ReadinessTaskState) SetStatus

func (s *ReadinessTaskState) SetStatus(status ReadinessTaskStatus)

func (*ReadinessTaskState) Status

func (*ReadinessTaskState) TraverseResourceStates

func (s *ReadinessTaskState) TraverseResourceStates(fromName, fromNamespace string, fromGroupVersionKind schema.GroupVersionKind) []*util.Concurrent[*ResourceState]

func (*ReadinessTaskState) UUID

func (s *ReadinessTaskState) UUID() string

type ReadinessTaskStateOptions

type ReadinessTaskStateOptions struct {
	FailMode                multitrack.FailMode
	TotalAllowFailuresCount int
}

type ReadinessTaskStatus

type ReadinessTaskStatus string
const (
	ReadinessTaskStatusProgressing ReadinessTaskStatus = "progressing"
	ReadinessTaskStatusReady       ReadinessTaskStatus = "ready"
	ReadinessTaskStatusFailed      ReadinessTaskStatus = "failed"
)

type ResourceState

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

func NewResourceState

func NewResourceState(name, namespace string, groupVersionKind schema.GroupVersionKind) *ResourceState

func (*ResourceState) AddAttribute

func (s *ResourceState) AddAttribute(attr Attributer)

func (*ResourceState) AddError

func (s *ResourceState) AddError(err error, source string, timestamp time.Time)

func (*ResourceState) AddEvent

func (s *ResourceState) AddEvent(message string, timestamp time.Time)

func (*ResourceState) Attributes

func (s *ResourceState) Attributes() []Attributer

func (*ResourceState) Errors

func (s *ResourceState) Errors() map[string][]*Error

func (*ResourceState) Events

func (s *ResourceState) Events() []*Event

func (*ResourceState) GroupVersionKind

func (s *ResourceState) GroupVersionKind() schema.GroupVersionKind

func (*ResourceState) ID

func (s *ResourceState) ID() string

func (*ResourceState) Name

func (s *ResourceState) Name() string

func (*ResourceState) Namespace

func (s *ResourceState) Namespace() string

func (*ResourceState) SetStatus

func (s *ResourceState) SetStatus(status ResourceStatus)

func (*ResourceState) Status

func (s *ResourceState) Status() ResourceStatus

type ResourceStatus

type ResourceStatus string
const (
	ResourceStatusUnknown ResourceStatus = "unknown"
	ResourceStatusReady   ResourceStatus = "ready"
	ResourceStatusCreated ResourceStatus = "created"
	ResourceStatusDeleted ResourceStatus = "deleted"
	ResourceStatusFailed  ResourceStatus = "failed"
)

type TaskStore

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

func NewTaskStore

func NewTaskStore() *TaskStore

func (*TaskStore) AbsenceTasksStates

func (s *TaskStore) AbsenceTasksStates() []*util.Concurrent[*AbsenceTaskState]

func (*TaskStore) AddAbsenceTaskState

func (s *TaskStore) AddAbsenceTaskState(task *util.Concurrent[*AbsenceTaskState])

func (*TaskStore) AddPresenceTaskState

func (s *TaskStore) AddPresenceTaskState(task *util.Concurrent[*PresenceTaskState])

func (*TaskStore) AddReadinessTaskState

func (s *TaskStore) AddReadinessTaskState(task *util.Concurrent[*ReadinessTaskState])

func (*TaskStore) PresenceTasksStates

func (s *TaskStore) PresenceTasksStates() []*util.Concurrent[*PresenceTaskState]

func (*TaskStore) ReadinessTasksStates

func (s *TaskStore) ReadinessTasksStates() []*util.Concurrent[*ReadinessTaskState]

Jump to

Keyboard shortcuts

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