Documentation
¶
Index ¶
Constants ¶
const (
InputTypeRequest = "request"
)
InputTypeRequest and others represent consts for Directives
const (
NamespaceDefault = "default"
)
NamespaceDefault and others represent conts for namespaces
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alias ¶
Alias is the parsed version of an entry in the `With` array from a CallableFn If you do user: activeUser, then activeUser is the state key and user is the key that gets put into the function's state (i.e. the alias)
type CallableFn ¶
type CallableFn struct {
Fn string `yaml:"fn,omitempty"`
As string `yaml:"as,omitempty"`
With []string `yaml:"with,omitempty"`
OnErr *FnOnErr `yaml:"onErr,omitempty"`
DesiredState []Alias `yaml:"-"`
}
CallableFn is a fn along with its "variable name" and "args"
func (*CallableFn) ParseWith ¶
func (c *CallableFn) ParseWith() ([]Alias, error)
ParseWith parses the fn's 'with' clause and returns the desired state
type Directive ¶
type Directive struct {
Identifier string `yaml:"identifier"`
AppVersion string `yaml:"appVersion"`
AtmoVersion string `yaml:"atmoVersion"`
Runnables []Runnable `yaml:"runnables"`
Handlers []Handler `yaml:"handlers,omitempty"`
Schedules []Schedule `yaml:"schedules,omitempty"`
// contains filtered or unexported fields
}
Directive describes a set of functions and a set of handlers that take an input, and compose a set of functions to handle it
type Executable ¶
type Executable struct {
CallableFn `yaml:"callableFn,inline"`
Group []CallableFn `yaml:"group,omitempty"`
}
Executable represents an executable step in a handler
func (*Executable) IsFn ¶
func (e *Executable) IsFn() bool
IsFn returns true if the executable is a group
func (*Executable) IsGroup ¶
func (e *Executable) IsGroup() bool
IsGroup returns true if the executable is a group
type FnOnErr ¶ added in v0.8.0
type FnOnErr struct {
Code map[int]string `yaml:"code,omitempty"`
Any string `yaml:"any,omitempty"`
Other string `yaml:"other,omitempty"`
}
FnOnErr describes how to handle an error from a function call
type Handler ¶
type Handler struct {
Input Input `yaml:"input,inline"`
Steps []Executable `yaml:"steps"`
Response string `yaml:"response,omitempty"`
}
Handler represents the mapping between an input and a composition of functions
type Runnable ¶
type Runnable struct {
Name string `yaml:"name"`
Namespace string `yaml:"namespace"`
Lang string `yaml:"lang"`
APIVersion string `yaml:"apiVersion,omitempty"`
}
Runnable is the structure of a .runnable.yaml file
type Schedule ¶ added in v0.7.1
type Schedule struct {
Name string `yaml:"name"`
Every ScheduleEvery `yaml:"every"`
State map[string]string `yaml:"state,omitempty"`
Steps []Executable `yaml:"steps"`
}
Schedule represents the mapping between an input and a composition of functions
func (*Schedule) NumberOfSeconds ¶ added in v0.7.1
NumberOfSeconds calculates the total time in seconds for the schedule's 'every' value