Documentation
¶
Index ¶
- type Action
- type ActionManager
- func (m *ActionManager) ActionByID(tx *sqlx.Tx, id int64) (model.Action, error)
- func (m *ActionManager) ActionByTag(tx *sqlx.Tx, tag names.ActionTag) (model.Action, error)
- func (m *ActionManager) ActionsByName(tx *sqlx.Tx, name string) ([]model.Action, error)
- func (m *ActionManager) AddAction(tx *sqlx.Tx, receiver names.Tag, operationID, actionName string, ...) (model.Action, error)
- func (m *ActionManager) StartUp(ctx context.Context) error
- func (m *ActionManager) Stop()
- type Backend
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
ID int64 `db:"id"`
Tag string `db:"tag"`
// Receiver is the Name of the Unit or any other ActionReceiver for
// which this Action is queued.
Receiver string `db:"receiver"`
// Name identifies the action that should be run; it should
// match an action defined by the unit's charm.
Name string `db:"name"`
// Parameters holds the action's parameters, if any; it should validate
// against the schema defined by the named action in the unit's charm.
Parameters []byte `db:"parameters_json"`
// Enqueued is the time the action was added.
Enqueued sql.NullTime `db:"enqueued"`
// Started reflects the time the action began running.
Started sql.NullTime `db:"started"`
// Completed reflects the time that the action was finished.
Completed sql.NullTime `db:"completed"`
// Operation is the parent operation of the action.
Operation string `db:"operation"`
// Status represents the end state of the Action; ActionFailed for an
// action that was removed prematurely, or that failed, and
// ActionCompleted for an action that successfully completed.
Status sql.NullString `db:"status"`
// Message captures any error returned by the action.
Message sql.NullString `db:"message"`
}
type ActionManager ¶
type ActionManager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(backend Backend) *ActionManager
NewManager creates a new manager from a backend.
func (*ActionManager) ActionByID ¶
ActionByID returns one action by id.
func (*ActionManager) ActionByTag ¶
ActionByTag returns one action by tag.
func (*ActionManager) ActionsByName ¶
ActionsByName returns a slice of actions that have the same name.
func (*ActionManager) AddAction ¶
func (m *ActionManager) AddAction(tx *sqlx.Tx, receiver names.Tag, operationID, actionName string, payload map[string]interface{}) (model.Action, error)
AddAction adds an action, returning the given action.
func (*ActionManager) Stop ¶
func (m *ActionManager) Stop()
Click to show internal directories.
Click to hide internal directories.