Documentation
¶
Overview ¶
Package flow runs a sequence of steps the model may name.
Index ¶
- func Format(defs []*Definition) ([]byte, error)
- func Lines(flows map[string]*Definition) []string
- func Match(line, query string) bool
- func RunFailure(def *Definition, err error) error
- func TaskRegressions(base, next []string) []string
- func Witness(def *Definition, cat *catalog.Catalog, bodies []string) ([]string, error)
- type Definition
- func Find(flows map[string]*Definition, query string) []*Definition
- func Parse(data []byte) (*Definition, error)
- func ParseFile(data []byte) ([]*Definition, error)
- func Propose(cat *catalog.Catalog) []*Definition
- func Review(def *Definition, cat *catalog.Catalog) *Definition
- func Suggest(cat *catalog.Catalog) *Definition
- func SuggestIn(cat *catalog.Catalog, first []string) *Definition
- func Teach(def *Definition, cat *catalog.Catalog) (*Definition, error)
- type MissingOutputError
- type Runner
- type Step
- type StoppedError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Format ¶ added in v0.1.9
func Format(defs []*Definition) ([]byte, error)
Format writes one task, or a flows list when there are several.
func Lines ¶ added in v0.1.9
func Lines(flows map[string]*Definition) []string
Lines returns one index line per task, sorted by name.
func Match ¶ added in v0.1.11
Match reports whether a task index line matches the query. The whole query may sit inside the line, or every significant word in the query may appear in it.
func RunFailure ¶ added in v0.1.9
func RunFailure(def *Definition, err error) error
RunFailure turns a stopped task run into the sentence the owner reviews.
func TaskRegressions ¶ added in v0.1.9
TaskRegressions reports a task the baseline could teach and the current lines cannot.
Types ¶
type Definition ¶
type Definition struct {
Name string `yaml:"name"`
Question string `yaml:"question,omitempty"`
Answer []string `yaml:"answer,omitempty"`
Steps []Step `yaml:"steps"`
}
func Find ¶ added in v0.1.9
func Find(flows map[string]*Definition, query string) []*Definition
Find returns tasks whose name, question, or answer matches the query.
func Parse ¶
func Parse(data []byte) (*Definition, error)
func ParseFile ¶ added in v0.1.9
func ParseFile(data []byte) ([]*Definition, error)
ParseFile reads one flow, or a flows list.
func Propose ¶ added in v0.1.9
func Propose(cat *catalog.Catalog) []*Definition
Propose returns a reviewable task for every declared relation between two reads. The question is the relation sentence. The answer lists the last operation's required response fields.
func Review ¶ added in v0.1.9
func Review(def *Definition, cat *catalog.Catalog) *Definition
Review returns the task a run confirmed. A binding the relation already supplies is left unset.
func Suggest ¶ added in v0.1.9
func Suggest(cat *catalog.Catalog) *Definition
Suggest returns one read-only task the catalog can already teach.
func SuggestIn ¶ added in v0.1.11
func SuggestIn(cat *catalog.Catalog, first []string) *Definition
SuggestIn returns one read-only task, preferring a no-argument read whose id is in first, after a declared relation.
func Teach ¶ added in v0.1.9
func Teach(def *Definition, cat *catalog.Catalog) (*Definition, error)
Teach fills bindings for a flow that has a question. A flow without a question is returned as parsed when its steps still name operations, fields, and parameters the catalog has.
func (*Definition) Binds ¶ added in v0.1.9
func (d *Definition) Binds() []string
Binds lists each value the task copies, as source field to target parameter.
func (*Definition) IndexLine ¶ added in v0.1.9
func (d *Definition) IndexLine() string
IndexLine is the task sentence search and the context pack share.
type MissingOutputError ¶ added in v0.1.9
MissingOutputError is a response that did not include the field the next step needs.
func (MissingOutputError) Error ¶ added in v0.1.9
func (e MissingOutputError) Error() string
type Runner ¶
type Step ¶
type StoppedError ¶
func (StoppedError) Error ¶
func (s StoppedError) Error() string