Documentation ¶
Overview ¶
Package `moveshadowwf` implements the move-shadow workflow, which changes the location of a shadow repo.
Workflow Events ¶
The workflow is initiated on a repo with `RepoEvent_EV_FSO_SHADOW_REPO_MOVE_STARTED`, currently by an admin using `nogfsoctl begin-move-shadow`.
Nogfsoregd replicate initializes the workflow aggregate with `WorkflowEvent_EV_FSO_SHADOW_REPO_MOVE_STARTED`. It then posts a notification on the registry `RegistryEvent_EV_FSO_SHADOW_REPO_MOVE_STARTED`, so that Nogfsostad can observe the start of the move-shadow workflow.
Nogfsostad disables the repo and posts `WorkflowEvent_EV_FSO_SHADOW_REPO_MOVE_STA_DISABLED` to confirm that it is disabled.
The workflow completes the move with `WorkflowEvent_EV_FSO_SHADOW_REPO_MOVED`, currently by an admin using `nogfsoctl commit-move-shadow`.
Nogfsoregd replicate commits the move to `RepoEvent_EV_FSO_SHADOW_REPO_MOVED` and terminates the workflow with `WorkflowEvent_EV_FSO_SHADOW_REPO_MOVE_COMMITTED`.
Index ¶
- Variables
- type Advancer
- type Behavior
- type CmdCommit
- type CmdExit
- type CmdInit
- type CmdPostStadDisabled
- type Event
- type State
- type Workflows
- func (r *Workflows) Commit(id uuid.I, vid ulid.I) (ulid.I, error)
- func (r *Workflows) Exit(id uuid.I, vid ulid.I) (ulid.I, error)
- func (r *Workflows) FindId(id uuid.I) (*State, error)
- func (r *Workflows) Init(id uuid.I, repoId uuid.I, repoEventId ulid.I) (ulid.I, error)
- func (r *Workflows) PostStadDisabled(id uuid.I, vid ulid.I) (ulid.I, error)
Constants ¶
This section is empty.
Variables ¶
var ErrConflict = errors.New("workflow conflict")
var ErrConflictInit = errors.New("workflow init conflict")
var ErrInvalidCommand = errors.New("invalid workflow command")
var ErrInvalidEventType = errors.New("invalid event type")
var ErrMoved = errors.New("workflow move completed")
var ErrNotMoved = errors.New("workflow did not complete move")
var ErrStaActive = errors.New("nogfsostad has yet not disabled the repo")
var ErrTerminated = errors.New("workflow terminated")
var ErrUninitialized = errors.New("workflow uninitialized")
var NoVC = events.NoVC
`NoVC` is a sentinel value that can be passed in place of `vid` to indicate that concurrency version checks are skipped.
Functions ¶
This section is empty.
Types ¶
type Advancer ¶
type Advancer struct {
// contains filtered or unexported fields
}
The bools indicate which part of the state has been duplicated.
type CmdCommit ¶
type CmdCommit struct{}
func (*CmdCommit) AggregateCommand ¶
func (*CmdCommit) AggregateCommand()
type CmdExit ¶
type CmdExit struct{}
func (*CmdExit) AggregateCommand ¶
func (*CmdExit) AggregateCommand()
type CmdInit ¶
func (*CmdInit) AggregateCommand ¶
func (*CmdInit) AggregateCommand()
type CmdPostStadDisabled ¶
type CmdPostStadDisabled struct{}
func (*CmdPostStadDisabled) AggregateCommand ¶
func (*CmdPostStadDisabled) AggregateCommand()
type Event ¶
func (*Event) UnmarshalProto ¶
type State ¶
type State struct {
// contains filtered or unexported fields
}
func (*State) AggregateState ¶
func (*State) AggregateState()
func (*State) IsTerminated ¶
type Workflows ¶
type Workflows struct {
// contains filtered or unexported fields
}
func (*Workflows) Exit ¶
`Exit()` terminates the workflow.
The workflow can currently only terminate successfully, which may change in the future when we add more error handling.