Documentation
¶
Index ¶
- type InMemoryStore
- func (s *InMemoryStore) AddTaskEvent(event event.Event) error
- func (s *InMemoryStore) DeleteTask(taskName string) error
- func (s *InMemoryStore) DeleteTaskEvents(taskName string) error
- func (s *InMemoryStore) GetAllTasks() config.TaskConfigs
- func (s *InMemoryStore) GetConfig() config.Config
- func (s *InMemoryStore) GetTask(taskName string) (config.TaskConfig, bool)
- func (s *InMemoryStore) GetTaskEvents(taskName string) map[string][]event.Event
- func (s *InMemoryStore) SetTask(newTaskConf config.TaskConfig) error
- type Store
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