Documentation
¶
Index ¶
- type Event
- type Manager
- func (m *Manager) Cancel(opID string) error
- func (m *Manager) CreateOperation(opType OperationType, metadata map[string]string) string
- func (m *Manager) EmitEvent(opID string, message string)
- func (m *Manager) GetOperation(opID string) (*Operation, error)
- func (m *Manager) GetPendingQueueCount() int
- func (m *Manager) IsConnected() bool
- func (m *Manager) ListOperations(filter func(*Operation) bool) []*Operation
- func (m *Manager) SetCompleted(opID string)
- func (m *Manager) SetConnectionState(connected bool)
- func (m *Manager) SetError(opID string, err error)
- func (m *Manager) SetProgress(opID string, progress int)
- func (m *Manager) SetState(opID string, state OperationState)
- func (m *Manager) Subscribe(opID string) <-chan Event
- func (m *Manager) Unsubscribe(opID string, ch <-chan Event)
- type Operation
- type OperationState
- type OperationType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) CreateOperation ¶
func (m *Manager) CreateOperation(opType OperationType, metadata map[string]string) string
CreateOperation creates a new operation
func (*Manager) GetOperation ¶
GetOperation retrieves operation by ID
func (*Manager) GetPendingQueueCount ¶
GetPendingQueueCount returns the number of operations waiting in the queue
func (*Manager) IsConnected ¶
IsConnected returns true if the agent is connected to core
func (*Manager) ListOperations ¶
ListOperations returns all operations
func (*Manager) SetCompleted ¶
SetCompleted marks operation as completed
func (*Manager) SetConnectionState ¶
SetConnectionState updates the connection state and processes queued operations
func (*Manager) SetProgress ¶
SetProgress updates operation progress
func (*Manager) SetState ¶
func (m *Manager) SetState(opID string, state OperationState)
SetState updates operation state
func (*Manager) Unsubscribe ¶
Unsubscribe removes a listener for operation events
type OperationState ¶
type OperationState int
const ( OperationStatePending OperationState = iota OperationStateRunning OperationStateCompleted OperationStateFailed OperationStateCancelled )
type OperationType ¶
type OperationType string
const ( OperationTypeStackApply OperationType = "stack.apply" OperationTypeStackRemove OperationType = "stack.remove" OperationTypeImagePull OperationType = "image.pull" OperationTypeExec OperationType = "container.exec" OperationTypeBackup OperationType = "backup" )
Click to show internal directories.
Click to hide internal directories.