Documentation
¶
Index ¶
- Variables
- func Provide(i *do.Injector)
- type LogEntry
- type Options
- type Service
- func (s *Service) AddLogEntry(ctx context.Context, databaseID string, taskID uuid.UUID, entry LogEntry) error
- func (s *Service) CreateTask(ctx context.Context, opts Options) (*Task, error)
- func (s *Service) DeleteAllTaskLogs(ctx context.Context, databaseID string) error
- func (s *Service) DeleteAllTasks(ctx context.Context, databaseID string) error
- func (s *Service) DeleteTask(ctx context.Context, databaseID string, taskID uuid.UUID) error
- func (s *Service) DeleteTaskLogs(ctx context.Context, databaseID string, taskID uuid.UUID) error
- func (s *Service) GetTask(ctx context.Context, databaseID string, taskID uuid.UUID) (*Task, error)
- func (s *Service) GetTaskLog(ctx context.Context, databaseID string, taskID uuid.UUID, ...) (*TaskLog, error)
- func (s *Service) GetTasks(ctx context.Context, databaseID string, options TaskListOptions) ([]*Task, error)
- func (s *Service) UpdateTask(ctx context.Context, task *Task) error
- type SortOrder
- type Status
- type Store
- type StoredTask
- type StoredTaskLogEntry
- type Task
- type TaskListOptions
- type TaskLog
- type TaskLogEntryStore
- func (s *TaskLogEntryStore) DatabasePrefix(databaseID string) string
- func (s *TaskLogEntryStore) DeleteByDatabaseID(databaseID string) storage.DeleteOp
- func (s *TaskLogEntryStore) DeleteByTaskID(databaseID string, taskID uuid.UUID) storage.DeleteOp
- func (s *TaskLogEntryStore) GetAllByTaskID(databaseID string, taskID uuid.UUID, options TaskLogOptions) storage.GetMultipleOp[*StoredTaskLogEntry]
- func (s *TaskLogEntryStore) Key(databaseID string, taskID, entryID uuid.UUID) string
- func (s *TaskLogEntryStore) Prefix() string
- func (s *TaskLogEntryStore) Put(item *StoredTaskLogEntry) storage.PutOp[*StoredTaskLogEntry]
- func (s *TaskLogEntryStore) TaskPrefix(databaseID string, taskID uuid.UUID) string
- type TaskLogOptions
- type TaskLogWriter
- type TaskStore
- func (s *TaskStore) Create(item *StoredTask) storage.PutOp[*StoredTask]
- func (s *TaskStore) DatabasePrefix(databaseID string) string
- func (s *TaskStore) Delete(databaseID string, taskID uuid.UUID) storage.DeleteOp
- func (s *TaskStore) DeleteByDatabaseID(databaseID string) storage.DeleteOp
- func (s *TaskStore) GetAllByDatabaseID(databaseID string, options TaskListOptions) storage.GetMultipleOp[*StoredTask]
- func (s *TaskStore) GetByKey(databaseID string, taskID uuid.UUID) storage.GetOp[*StoredTask]
- func (s *TaskStore) Key(databaseID string, taskID uuid.UUID) string
- func (s *TaskStore) Prefix() string
- func (s *TaskStore) Update(item *StoredTask) storage.PutOp[*StoredTask]
- type Type
- type UpdateOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTaskNotFound = errors.New("task not found")
Functions ¶
Types ¶
type Options ¶
type Options struct {
ParentID uuid.UUID `json:"parent_id"`
DatabaseID string `json:"database_id"`
NodeName string `json:"node_name"`
InstanceID string `json:"instance_id"`
HostID string `json:"host_id"`
Type Type `json:"type"`
WorkflowInstanceID string `json:"workflow_id"`
WorkflowExecutionID string `json:"workflow_execution_id"`
}
type Service ¶
type Service struct {
Store *Store
}
func NewService ¶
func (*Service) AddLogEntry ¶
func (*Service) CreateTask ¶
func (*Service) DeleteAllTaskLogs ¶
func (*Service) DeleteAllTasks ¶
func (*Service) DeleteTask ¶
func (*Service) DeleteTaskLogs ¶
func (*Service) GetTaskLog ¶
type Store ¶
type Store struct {
Task *TaskStore
TaskLogMessage *TaskLogEntryStore
// contains filtered or unexported fields
}
type StoredTask ¶
type StoredTask struct {
storage.StoredValue
Task *Task `json:"task"`
}
type StoredTaskLogEntry ¶
type Task ¶
type Task struct {
ParentID uuid.UUID `json:"parent_id"`
DatabaseID string `json:"database_id"`
NodeName string `json:"node_name"`
InstanceID string `json:"instance_id"`
HostID string `json:"host_id"`
TaskID uuid.UUID `json:"task_id"`
CreatedAt time.Time `json:"created_at"`
CompletedAt time.Time `json:"completed_at"`
Type Type `json:"type"`
WorkflowInstanceID string `json:"workflow_id"`
WorkflowExecutionID string `json:"workflow_execution_id"`
Status Status `json:"status"`
Error string `json:"error"`
}
func (*Task) IsComplete ¶
func (*Task) SetCompleted ¶
func (t *Task) SetCompleted()
func (*Task) Update ¶
func (t *Task) Update(options UpdateOptions)
type TaskListOptions ¶
type TaskLogEntryStore ¶
type TaskLogEntryStore struct {
// contains filtered or unexported fields
}
func NewTaskLogEntryStore ¶
func NewTaskLogEntryStore(client *clientv3.Client, root string) *TaskLogEntryStore
func (*TaskLogEntryStore) DatabasePrefix ¶
func (s *TaskLogEntryStore) DatabasePrefix(databaseID string) string
func (*TaskLogEntryStore) DeleteByDatabaseID ¶
func (s *TaskLogEntryStore) DeleteByDatabaseID(databaseID string) storage.DeleteOp
func (*TaskLogEntryStore) DeleteByTaskID ¶
func (*TaskLogEntryStore) GetAllByTaskID ¶
func (s *TaskLogEntryStore) GetAllByTaskID(databaseID string, taskID uuid.UUID, options TaskLogOptions) storage.GetMultipleOp[*StoredTaskLogEntry]
func (*TaskLogEntryStore) Key ¶
func (s *TaskLogEntryStore) Key(databaseID string, taskID, entryID uuid.UUID) string
func (*TaskLogEntryStore) Prefix ¶
func (s *TaskLogEntryStore) Prefix() string
func (*TaskLogEntryStore) Put ¶
func (s *TaskLogEntryStore) Put(item *StoredTaskLogEntry) storage.PutOp[*StoredTaskLogEntry]
func (*TaskLogEntryStore) TaskPrefix ¶
func (s *TaskLogEntryStore) TaskPrefix(databaseID string, taskID uuid.UUID) string
type TaskLogOptions ¶
type TaskLogWriter ¶
type TaskLogWriter struct {
DatabaseID string
TaskID uuid.UUID
// contains filtered or unexported fields
}
func NewTaskLogWriter ¶
func (*TaskLogWriter) Close ¶
func (w *TaskLogWriter) Close() error
type TaskStore ¶
type TaskStore struct {
// contains filtered or unexported fields
}
func (*TaskStore) Create ¶
func (s *TaskStore) Create(item *StoredTask) storage.PutOp[*StoredTask]
func (*TaskStore) DatabasePrefix ¶
func (*TaskStore) DeleteByDatabaseID ¶
func (*TaskStore) GetAllByDatabaseID ¶
func (s *TaskStore) GetAllByDatabaseID(databaseID string, options TaskListOptions) storage.GetMultipleOp[*StoredTask]
func (*TaskStore) Update ¶
func (s *TaskStore) Update(item *StoredTask) storage.PutOp[*StoredTask]
type Type ¶
type Type string
const ( TypeCreate Type = "create" TypeUpdate Type = "update" TypeDelete Type = "delete" TypeNodeBackup Type = "node_backup" TypeRestore Type = "restore" TypeNodeRestore Type = "node_restore" TypeRestartInstance Type = "restart_instance" TypeStopInstance Type = "stop_instance" TypeStartInstance Type = "start_instance" TypeSwitchover Type = "switchover" TypeFailover Type = "failover" TypeRemoveHost Type = "remove_host" )
type UpdateOptions ¶
type UpdateOptions struct {
NodeName *string `json:"node_name,omitempty"`
InstanceID *string `json:"instance_id,omitempty"`
HostID *string `json:"host_id,omitempty"`
WorkflowInstanceID *string `json:"workflow_instance_id,omitempty"`
WorkflowExecutionID *string `json:"workflow_execution_id,omitempty"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
Status *Status `json:"status,omitempty"`
Error *string `json:"error,omitempty"`
}
func UpdateCancel ¶
func UpdateCancel() UpdateOptions
func UpdateComplete ¶
func UpdateComplete() UpdateOptions
func UpdateFail ¶
func UpdateFail(cause error) UpdateOptions
func UpdateStart ¶
func UpdateStart() UpdateOptions
Click to show internal directories.
Click to hide internal directories.