Documentation
¶
Index ¶
- Variables
- func BackgroundDiscard(chg *state.Change, workshop string)
- func ChangeAttempt(change *state.Change) (int, error)
- func CheckChangeConflict(st *state.State, projectId, workshop string, ignoreKinds []string) error
- func FindChangeByKind(st *state.State, projectId, workshop, kind string) (string, error)
- func ResumeAfterWait(st *state.State, format sdk.Revision, workshop string, projectId string, ...) (*state.Change, error)
- type ChangeActionMismatch
- type ChangeConflictError
- type ChangeSetup
- type Mode
- type RefreshOption
Constants ¶
This section is empty.
Variables ¶
var ErrorNoWaitingChange = errors.New("no waiting change in progress")
ErrorNoWaitingChange signals that an abort or continue had no change to resume: no change is in progress for the workshop at all. Match it with errors.Is.
Functions ¶
func BackgroundDiscard ¶ added in v0.9.1
func CheckChangeConflict ¶
Iterates over the list of running tasks and returns a ChangeConflictError if there is a change running for the provided projectID / workshop pair. Ignores certain kinds of changes based on the ignoreKinds argument. Ignore discarded changes.
func FindChangeByKind ¶
Iterates over the list of running tasks and returns a change ID if there is a change running for the provided projectID, workshop and kind. Ignore discard-background changes.
func ResumeAfterWait ¶
func ResumeAfterWait( st *state.State, format sdk.Revision, workshop string, projectId string, mode Mode, action string, ) (*state.Change, error)
Attempt to resume the change associated with the Resume/Launch operation for the given workshop. Depending on the mode the change will either be turned into Doing (Continue mode) or Abort (Abort mode).
Types ¶
type ChangeActionMismatch ¶ added in v0.9.2
type ChangeActionMismatch string
func (ChangeActionMismatch) Error ¶ added in v0.9.2
func (e ChangeActionMismatch) Error() string
type ChangeConflictError ¶
type ChangeConflictError struct {
ProjectId string
Workshop string
ChangeKind string
ChangeStatus string
// a Message is optional, otherwise one is composed from the other information
Message string
// ChangeID can optionally be set to the ID of the change with which the operation conflicts
ChangeID string
}
ChangeConflictError represents an error because of snap conflicts between changes.
func (*ChangeConflictError) Error ¶
func (e *ChangeConflictError) Error() string
type ChangeSetup ¶
type ChangeSetup struct {
Mode string `json:"mode"`
}
type RefreshOption ¶
type RefreshOption int
const ( RefreshUpdate RefreshOption = iota RefreshRestore )
func ParseRefreshSetting ¶
func ParseRefreshSetting(s string) (RefreshOption, error)
func (RefreshOption) String ¶
func (s RefreshOption) String() string