Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ErrUpgradeInProgress indicates that an upgrade is already in progress. ErrUpgradeInProgress = errors.ConstError("upgrade in progress") )
Variables ¶
View Source
var ( ErrAlreadyAtState = errors.ConstError("already at state") ErrUnableToTransition = errors.ConstError("unable to transition") )
View Source
var States = map[State]string{ Created: "created", Started: "started", DBCompleted: "db-completed", StepsCompleted: "steps-completed", Error: "error", }
States holds all the possible states.
Functions ¶
This section is empty.
Types ¶
type Info ¶
type Info struct { // UUID holds the upgrader's ID. UUID string // PreviousVersion holds the previous version. PreviousVersion string // TargetVersion holds the target version. TargetVersion string // State holds the current state of the upgrade. State State }
Info holds the information about database upgrade
type State ¶
type State int
State represents the state of the upgrade.
const ( // Created is the initial state of an upgrade. All upgrades should start // in this initial state. Created State = iota // Started is the state of an upgrade after it has been started. Started // DBCompleted is the state of an upgrade after the database has been // upgraded. DBCompleted // StepsCompleted is the state of an upgrade after all the steps have // been completed. StepsCompleted // Error is the state of an upgrade after an error has occurred. Error )
func ParseState ¶
ParseState returns the state from a string.
func (State) IsTerminal ¶
IsTerminal returns true if the state is terminal. A terminal state is one that cannot be transitioned from.
func (State) TransitionTo ¶
TransitionTo returns an error if the transition is not allowed.
Click to show internal directories.
Click to hide internal directories.