Documentation ¶
Overview ¶
Package store provides a way for the apatelet to have state
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FlagGetter ¶
type FlagGetter interface { // GetNodeFlag returns the value of the given node flag GetNodeFlag(events.NodeEventFlag) (interface{}, error) // GetPodFlag returns the value of the given pod for a configuration GetPodFlag(*corev1.Pod, events.PodEventFlag) (interface{}, error) }
FlagGetter defines function aiding in retrieving flags
type FlagSetter ¶
type FlagSetter interface { // SetNodeFlag sets the value of the given node flag SetNodeFlags(Flags) // SetNodeFlag sets the value of the given pod flag for a configuration SetPodFlags(string, Flags) // SetNodeFlag sets the value of the given pod flag for a configuration SetPodTimeFlags(string, []*TimeFlags) }
FlagSetter defines function aiding in setting flags
type NodeTask ¶
type NodeTask struct {
State *nodeconfigv1.NodeConfigurationState
}
NodeTask is a task that should be executed on a node level
type PodTask ¶
type PodTask struct { // The label of the CRD, should be <namespace>/<name> Label string State *podconfigv1.PodConfigurationState }
PodTask is a task that should be executed on a pod level
type Store ¶
type Store interface { TaskSetter FlagSetter FlagGetter // RemovePodTasks removes pod CRD tasks from the queue based on their label (<namespace>/<name>) RemovePodTasks(string) error // PeekTask returns the start time of the next task in the priority queue, without removing it from the queue PeekTask() (time.Duration, bool, error) // PopTask returns the first task to be executed and removes it from the queue PopTask() (*Task, error) // AddPodFlagListener adds a listener which is called when the given flag is updated AddPodFlagListener(events.PodEventFlag, func(interface{})) }
Store represents the state of the apatelet
type Task ¶
type Task struct { // The timestamp on which this task should be executed, relative to the start of the scenario RelativeTimestamp time.Duration PodTask *PodTask NodeTask *NodeTask }
Task is a task in the PQ
func NewNodeTask ¶
func NewNodeTask(relativeTime time.Duration, state *nodeconfigv1.NodeConfigurationState) *Task
NewNodeTask creates a new task for a node event
func NewPodTask ¶
func NewPodTask(relativeTime time.Duration, label string, state *podconfigv1.PodConfigurationState) *Task
NewPodTask creates a new task for a pod event
type TaskSetter ¶
type TaskSetter interface { // SetNodeTasks adds or updates node tasks // Existing node tasks will be removed if not in the list of tasks SetNodeTasks([]*Task) error // SetPodTasks adds or updates pod CRD tasks to the queue based on their label (<namespace>/<name>) // Existing pod tasks will be removed if not in the list of tasks SetPodTasks(string, []*Task) error }
TaskSetter defines function aiding in setting tasks
type TaskTypeCheck ¶
TaskTypeCheck is function which is able to determine if the given task is of a certain type
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_store is a generated GoMock package.
|
Package mock_store is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.