Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Flow ¶
type Flow struct {
// contains filtered or unexported fields
}
Flow represents the progress of a single pipeline.Pipeline run. The flow consists of working specification.Scenario and specification.Thesis statuses. Each ApplyStep call moves the progress forward.
func FromStatuses ¶
FromStatuses start a new flow from initialized statuses.
This method is similar to the other, but this method is intended solely for testing purposes.
func Fulfill ¶
Fulfill starts a new flow from pipeline.Pipeline. The result of the function is a Flow, with which you can collect the steps during pipeline execution.
Each step contains information about the progress of the pipeline, including pipeline.Event. The states of statuses change under the action of events. The transition rules for the event are described in the State.Next method.
func (*Flow) ApplyStep ¶
ApplyStep is method for step by step collecting pipeline.Pipeline steps to move the progress of the pipeline by changing status states.
Flow state changes from call to call relying on the state transition rules in State.Next method.
func (*Flow) OverallState ¶
OverallState returns general Flow status selected from all specification.Scenario states according to State.Precedence.
func (*Flow) PipelineID ¶
PipelineID returns associated with Flow pipeline identifier.
type State ¶
type State string
func (State) Next ¶
Next returns the next state depending on the received pipeline.Event.
State transition rules are defined for a finite automaton, then this function is a transition function for this automaton.
func (State) Precedence ¶
Precedence indicates the priority in which the overall state will be selected from the entire scenario states.
The larger the number, the more likely it is that this state will be selected as an overall one.
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
Status represents progress of the specification.Scenario.
func NewStatus ¶
func NewStatus(slug specification.Slug, state State, thesisStatuses ...*ThesisStatus) *Status
NewStatus creates a progress representation of specification.Scenario.
If the slug is not specification.ScenarioSlug, it panics with specification.ErrNotScenarioSlug.
func (*Status) Slug ¶
func (s *Status) Slug() specification.Slug
Slug returns associated with Status scenario slug.
func (*Status) ThesisStatuses ¶
func (s *Status) ThesisStatuses() []*ThesisStatus
ThesisStatuses returns nested in Status thesis statuses.
type ThesisStatus ¶
type ThesisStatus struct {
// contains filtered or unexported fields
}
ThesisStatus represents progress of the specification.Thesis nested in Status.
func NewThesisStatus ¶
func NewThesisStatus(slug string, state State, occurredErrs ...string) *ThesisStatus
NewThesisStatus creates a progress representation of specification.Thesis.
func (*ThesisStatus) OccurredErrs ¶
func (s *ThesisStatus) OccurredErrs() []string
OccurredErrs returns errors that occurred during executing of theses.
func (*ThesisStatus) ThesisSlug ¶
func (s *ThesisStatus) ThesisSlug() string
ThesisSlug returns associated with ThesisStatus partial thesis slug.