Documentation ¶
Index ¶
Constants ¶
const ( // WARNING indicates a mistake that might affect correctness WARNING // ERROR indicates a mistake that prevents execution of any workflows in the file ERROR // FATAL indicates a mistake that prevents even drawing the file FATAL )
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
func Parse(reader io.Reader, options ...OptionFunc) (*model.Configuration, error)
Parse parses a .workflow file and return the actions and global variables found within.
Types ¶
type Error ¶
type Error struct { Errors []*ParseError Actions []*model.Action Workflows []*model.Workflow // contains filtered or unexported fields }
func (*Error) FirstError ¶
FirstError searches a Configuration for the first error at or above a given severity level. Checking the return value against nil is a good way to see if the file has any errors at or above the given severity. A caller intending to execute the file might check for `errors.FirstError(parser.WARNING)`, while a caller intending to display the file might check for `errors.FirstError(parser.FATAL)`.
type OptionFunc ¶
type OptionFunc func(*Parser)
func WithSuppressErrors ¶
func WithSuppressErrors() OptionFunc
func WithSuppressWarnings ¶
func WithSuppressWarnings() OptionFunc
type ParseError ¶
ParseError represents an error identified by the parser, either syntactic (HCL) or semantic (.workflow) in nature. There are fields for location (File, Line, Column), severity, and base error string. The `Error()` function on this type concatenates whatever bits of the location are available with the message. The severity is only used for filtering.
func (*ParseError) Error ¶
func (e *ParseError) Error() string