Help us shape the future of Go! Take the 2026 Go Developer Survey

state

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryStore

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

InMemoryStore implements the CTS state Store interface.

func NewInMemoryStore

func NewInMemoryStore(conf *config.Config) *InMemoryStore

NewInMemoryStore returns a new in-memory store for CTS state

func (*InMemoryStore) AddTaskEvent

func (s *InMemoryStore) AddTaskEvent(event event.Event) error

AddTaskEvent adds an event to the store for the task configured in the event.

func (*InMemoryStore) DeleteTask

func (s *InMemoryStore) DeleteTask(taskName string) error

DeleteTask deletes the task config if it exists. The returned error will always be nil.

func (*InMemoryStore) DeleteTaskEvents

func (s *InMemoryStore) DeleteTaskEvents(taskName string) error

DeleteTaskEvents deletes all the events for a given task The returned error will always be nil.

func (*InMemoryStore) GetAllTasks

func (s *InMemoryStore) GetAllTasks() config.TaskConfigs

GetAllTasks returns a copy of the configs for all the tasks

func (*InMemoryStore) GetConfig

func (s *InMemoryStore) GetConfig() config.Config

GetConfig returns a copy of the CTS configuration

func (*InMemoryStore) GetTask

func (s *InMemoryStore) GetTask(taskName string) (config.TaskConfig, bool)

GetTask returns a copy of the task configuration. If the task name does not exist, then it returns false

func (*InMemoryStore) GetTaskEvents

func (s *InMemoryStore) GetTaskEvents(taskName string) map[string][]event.Event

GetTaskEvents returns all the events for a task. If no task name is specified, then it returns events for all tasks

func (*InMemoryStore) SetTask

func (s *InMemoryStore) SetTask(newTaskConf config.TaskConfig) error

SetTask adds a new task configuration or overwrites an existing task configuration with the same name. The returned error will always be nil.

type Store

type Store interface {

	// GetConfig returns a copy of the CTS configuration
	GetConfig() config.Config

	// GetAllTasks returns a copy of the configs for all the tasks
	GetAllTasks() config.TaskConfigs

	// GetTask returns a copy of the task configuration. If the task name does
	// not exist, then it returns false
	GetTask(taskName string) (config.TaskConfig, bool)

	// SetTask adds a new task configuration or does a patch update to an
	// existing task configuration with the same name
	SetTask(taskConf config.TaskConfig) error

	// DeleteTask deletes the task config if it exists
	DeleteTask(taskName string) error

	// GetTaskEvents returns all the events for a task. If no task name is
	// specified, then it returns events for all tasks
	GetTaskEvents(taskName string) map[string][]event.Event

	// DeleteTaskEvents deletes all the events for a given task
	DeleteTaskEvents(taskName string) error

	// AddTaskEvent adds an event to the store for the task configured in the
	// event
	AddTaskEvent(event event.Event) error
}

Store stores the CTS state

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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