Documentation ¶
Index ¶
- Constants
- Variables
- func CopyChildren(from goldast.Node, to goldast.Node)
- func CopyNode(node goldast.Node) goldast.Node
- func CopySettings(from goldast.Node, to goldast.Node)
- func DetermineSkipTarget(n *SkipBlock) goldast.Node
- func FillInvokeBlocks(node goldast.Node, maxRecursion int) error
- func FindNode(parent gold_ast.Node, finder func(n gold_ast.Node) bool) gold_ast.Node
- func FindNodeBackwards(currentNode gold_ast.Node, finder func(n gold_ast.Node) bool) gold_ast.Node
- func FindNodeBackwardsDeeply(currentNode gold_ast.Node, finder func(n gold_ast.Node) bool) gold_ast.Node
- func PopulateSkipTargets(doc *goldast.Document)
- func PruneActions(doc goldast.Node)
- func PruneDocumentToRoot(doc goldast.Node)
- func PruneDocumentToSection(doc goldast.Node, sectionName string) *goldast.Document
- type Conditional
- type ConditionalEnd
- type ConditionalImpl
- type ConditionalStart
- type DescriptionBlock
- type EnvironmentSubstitution
- type ExecutionBlock
- type FarSkip
- type IgnoreBlock
- type ImportBlock
- type InvisibleBlock
- type InvokeBlock
- type OnFailure
- type OptionType
- type OptionTypeRuntime
- type RundownBlock
- func (n *RundownBlock) Dump(source []byte, level int)
- func (r *RundownBlock) GetAttr(name string) null.String
- func (r *RundownBlock) GetAttrList(name string) []string
- func (r *RundownBlock) GetFirstAttr(names ...string) null.String
- func (r *RundownBlock) HasAttr(names ...string) bool
- func (n *RundownBlock) Kind() goldast.NodeKind
- type SaveCodeBlock
- type SectionGroup
- type SectionOption
- type SectionPointer
- func FindParentSection(heading goldast.Node) *SectionPointer
- func FindSectionInDocument(parent goldast.Node, name string) *SectionPointer
- func GetNextSection(section *SectionPointer) *SectionPointer
- func GetSectionForNode(node goldast.Node) *SectionPointer
- func GetSections(doc goldast.Node) []*SectionPointer
- func NewSectionPointer(name string) *SectionPointer
- func (n *SectionPointer) AddOption(option *SectionOption)
- func (n *SectionPointer) Dump(source []byte, level int)
- func (n *SectionPointer) FirstContentNode() goldast.Node
- func (n *SectionPointer) GetOption(name string) *SectionOption
- func (n *SectionPointer) GetOptionByEnvName(name string) *SectionOption
- func (n *SectionPointer) Kind() goldast.NodeKind
- func (n *SectionPointer) ParseOptions(options map[string]string) (map[string]string, error)
- func (n *SectionPointer) ParseOptionsWithResolution(options map[string]string, env map[string]string) (map[string]string, error)
- func (n *SectionPointer) ParseOptionsWithResolutionByName(options map[string]string, env map[string]string) (map[string]string, error)
- type SkipBlock
- type SpinnerMode
- type StopFail
- type StopOk
- type SubEnvBlock
- type TypeBoolean
- type TypeEnum
- type TypeFilename
- type TypeInt
- type TypeString
Constants ¶
const DefaultSpinnerName string = "Running..."
Variables ¶
var KindConditionalEnd = goldast.NewNodeKind("ConditionalEnd")
var KindConditionalStart = goldast.NewNodeKind("ConditionalStart")
KindRundownBlock is a NodeKind of the RundownBlock node.
var KindDescriptionBlock = goldast.NewNodeKind("DescriptionBlock")
KindRundownBlock is a NodeKind of the RundownBlock node.
var KindEnvironmentSubstitution = goldast.NewNodeKind("EnvironmentSubstitution")
KindRundownBlock is a NodeKind of the RundownBlock node.
var KindExecutionBlock = goldast.NewNodeKind("ExecutionBlock")
KindRundownBlock is a NodeKind of the RundownBlock node.
var KindIgnoreBlock = goldast.NewNodeKind("IgnoreBlock")
KindRundownBlock is a NodeKind of the RundownBlock node.
var KindImportBlock = goldast.NewNodeKind("ImportBlock")
KindRundownBlock is a NodeKind of the RundownBlock node.
var KindInvisibleBlock = goldast.NewNodeKind("InvisibleBlock")
KindRundownBlock is a NodeKind of the RundownBlock node.
var KindInvokeBlock = goldast.NewNodeKind("InvokeBlock")
KindRundownBlock is a NodeKind of the RundownBlock node.
var KindOnFailure = goldast.NewNodeKind("OnFailure")
KindRundownBlock is a NodeKind of the RundownBlock node.
var KindRundownBlock = goldast.NewNodeKind("RundownBlock")
KindRundownBlock is a NodeKind of the RundownBlock node.
var KindSaveCodeBlock = goldast.NewNodeKind("SaveCodeBlock")
KindRundownBlock is a NodeKind of the RundownBlock node.
var KindSectionGroup = goldast.NewNodeKind("SectionGroup")
KindRundownBlock is a NodeKind of the RundownBlock node.
var KindSectionOption = goldast.NewNodeKind("SectionOption")
KindRundownBlock is a NodeKind of the RundownBlock node.
var KindSectionPointer = goldast.NewNodeKind("SectionPointer")
KindRundownBlock is a NodeKind of the RundownBlock node.
var KindSkipBlock = goldast.NewNodeKind("SkipBlock")
var KindStopFail = goldast.NewNodeKind("StopFail")
KindRundownBlock is a NodeKind of the RundownBlock node.
var KindStopOk = goldast.NewNodeKind("StopOk")
KindRundownBlock is a NodeKind of the RundownBlock node.
var KindSubEnvBlock = goldast.NewNodeKind("SubEnvBlock")
KindRundownBlock is a NodeKind of the RundownBlock node.
Functions ¶
func DetermineSkipTarget ¶
func FillInvokeBlocks ¶
Iterates through each child of the given block, identifying InvokeBlocks and copying the invocation contents into the block.
func FindNodeBackwards ¶
Searches previous siblings, and then previous parent's siblings, and so on
func FindNodeBackwardsDeeply ¶
func FindNodeBackwardsDeeply(currentNode gold_ast.Node, finder func(n gold_ast.Node) bool) gold_ast.Node
Searches backwards depth-first.
func PopulateSkipTargets ¶
Populates the next AST node for each of the Skip nodes.
func PruneActions ¶
func PruneDocumentToRoot ¶
Types ¶
type Conditional ¶
type ConditionalEnd ¶
type ConditionalEnd struct { goldast.BaseBlock Start *ConditionalStart }
func (*ConditionalEnd) Dump ¶
func (n *ConditionalEnd) Dump(source []byte, level int)
func (*ConditionalEnd) Kind ¶
func (n *ConditionalEnd) Kind() goldast.NodeKind
Kind implements Node.Kind.
type ConditionalImpl ¶
type ConditionalImpl struct {
// contains filtered or unexported fields
}
func (*ConditionalImpl) GetIfScript ¶
func (n *ConditionalImpl) GetIfScript() string
func (*ConditionalImpl) GetResult ¶
func (n *ConditionalImpl) GetResult() bool
func (*ConditionalImpl) HasIfScript ¶
func (n *ConditionalImpl) HasIfScript() bool
func (*ConditionalImpl) HasResult ¶
func (n *ConditionalImpl) HasResult() bool
func (*ConditionalImpl) SetIfScript ¶
func (n *ConditionalImpl) SetIfScript(script string)
func (*ConditionalImpl) SetResult ¶
func (n *ConditionalImpl) SetResult(result bool)
type ConditionalStart ¶
type ConditionalStart struct { goldast.BaseBlock ConditionalImpl ID string End *ConditionalEnd }
func NewConditionalStart ¶
func NewConditionalStart() *ConditionalStart
NewRundownBlock returns a new RundownBlock node.
func (*ConditionalStart) Dump ¶
func (n *ConditionalStart) Dump(source []byte, level int)
func (*ConditionalStart) GetEndSkipNode ¶
func (n *ConditionalStart) GetEndSkipNode(goldast.Node) goldast.Node
func (*ConditionalStart) Kind ¶
func (n *ConditionalStart) Kind() goldast.NodeKind
Kind implements Node.Kind.
type DescriptionBlock ¶
func GetRootHelp ¶
func GetRootHelp(doc goldast.Node) *DescriptionBlock
Walks through the top-level nodes in the AST under document. Will return the first help node before the sections begin.
func NewDescriptionBlock ¶
func NewDescriptionBlock() *DescriptionBlock
NewRundownBlock returns a new RundownBlock node.
func (*DescriptionBlock) Dump ¶
func (n *DescriptionBlock) Dump(source []byte, level int)
func (*DescriptionBlock) Kind ¶
func (n *DescriptionBlock) Kind() goldast.NodeKind
Kind implements Node.Kind.
type EnvironmentSubstitution ¶
func NewSubEnvInline ¶
func NewSubEnvInline(contents string) *EnvironmentSubstitution
NewRundownBlock returns a new RundownBlock node.
func (*EnvironmentSubstitution) Dump ¶
func (n *EnvironmentSubstitution) Dump(source []byte, level int)
func (*EnvironmentSubstitution) Kind ¶
func (n *EnvironmentSubstitution) Kind() goldast.NodeKind
Kind implements Node.Kind.
type ExecutionBlock ¶
type ExecutionBlock struct { goldast.BaseBlock ConditionalImpl CodeBlock *goldast.FencedCodeBlock ID string ShowStdout bool ShowStderr bool CaptureStdoutInto string Reveal bool Execute bool CaptureEnvironment []string SubstituteEnvironment bool SpinnerName string SpinnerMode SpinnerMode With string Language string ReplaceProcess bool SkipOnSuccess bool SkipOnFailure bool }
func NewExecutionBlock ¶
func NewExecutionBlock(fcb *goldast.FencedCodeBlock) *ExecutionBlock
NewRundownBlock returns a new RundownBlock node.
func (*ExecutionBlock) Dump ¶
func (n *ExecutionBlock) Dump(source []byte, level int)
func (*ExecutionBlock) Kind ¶
func (n *ExecutionBlock) Kind() goldast.NodeKind
Kind implements Node.Kind.
type IgnoreBlock ¶
func NewIgnoreBlock ¶
func NewIgnoreBlock() *IgnoreBlock
NewRundownBlock returns a new RundownBlock node.
func (*IgnoreBlock) Dump ¶
func (n *IgnoreBlock) Dump(source []byte, level int)
type ImportBlock ¶
The rundown import block expects to wrap a markdown link to the file to import.
For example: <r import="ci">[Our CI scripts](./ci/RUNDOWN.md)</r>
Will import our the ./ci/RUNDOWN.md file, namespacing all commands under the "ci:" prefix.
func NewImportBlock ¶
func NewImportBlock() *ImportBlock
NewImportBlock returns a new RundownBlock node.
func ProcessImportBlocks ¶
func ProcessImportBlocks(doc goldast.Node) []*ImportBlock
func (*ImportBlock) Dump ¶
func (n *ImportBlock) Dump(source []byte, level int)
func (*ImportBlock) GetFilename ¶
func (n *ImportBlock) GetFilename() string
func (*ImportBlock) IngestChildren ¶
func (n *ImportBlock) IngestChildren(doc goldast.Node)
type InvisibleBlock ¶
func NewInvisibleBlock ¶
func NewInvisibleBlock() *InvisibleBlock
NewRundownBlock returns a new RundownBlock node.
func (*InvisibleBlock) Dump ¶
func (n *InvisibleBlock) Dump(source []byte, level int)
func (*InvisibleBlock) Kind ¶
func (n *InvisibleBlock) Kind() goldast.NodeKind
Kind implements Node.Kind.
type InvokeBlock ¶
type InvokeBlock struct { goldast.BaseBlock Invoke string AsDependency bool Args map[string]string PreviousEnv map[string]string Target *SectionPointer }
func NewInvokeBlock ¶
func NewInvokeBlock() *InvokeBlock
NewRundownBlock returns a new RundownBlock node.
func (*InvokeBlock) Dump ¶
func (n *InvokeBlock) Dump(source []byte, level int)
type OnFailure ¶
func GetOnFailureNodes ¶
Searches the current node's section for OnFailure nodes and returns them.
func (*OnFailure) ConvertToParagraph ¶
func (*OnFailure) MatchesError ¶
type OptionType ¶
type OptionType interface { Validate(input string) error Normalise(input string) string Describe() string }
func BuildOptionType ¶
func BuildOptionType(optionType string) OptionType
type OptionTypeRuntime ¶
type RundownBlock ¶
func NewRundownBlock ¶
func NewRundownBlock() *RundownBlock
NewRundownBlock returns a new RundownBlock node.
func (*RundownBlock) Dump ¶
func (n *RundownBlock) Dump(source []byte, level int)
Dump implements Node.Dump.
func (*RundownBlock) GetAttr ¶
func (r *RundownBlock) GetAttr(name string) null.String
func (*RundownBlock) GetAttrList ¶
func (r *RundownBlock) GetAttrList(name string) []string
func (*RundownBlock) GetFirstAttr ¶
func (r *RundownBlock) GetFirstAttr(names ...string) null.String
func (*RundownBlock) HasAttr ¶
func (r *RundownBlock) HasAttr(names ...string) bool
func (*RundownBlock) Kind ¶
func (n *RundownBlock) Kind() goldast.NodeKind
Kind implements Node.Kind.
type SaveCodeBlock ¶
type SaveCodeBlock struct { goldast.BaseBlock CodeBlock *goldast.FencedCodeBlock Reveal bool SaveToVariable string Replacements map[string]string }
func NewSaveCodeBlock ¶
func NewSaveCodeBlock(fcb *goldast.FencedCodeBlock, saveToVariable string) *SaveCodeBlock
NewRundownBlock returns a new RundownBlock node.
func (*SaveCodeBlock) Dump ¶
func (n *SaveCodeBlock) Dump(source []byte, level int)
func (*SaveCodeBlock) Kind ¶
func (n *SaveCodeBlock) Kind() goldast.NodeKind
Kind implements Node.Kind.
type SectionGroup ¶
type SectionGroup struct { goldast.BaseBlock Name string DescriptionShort string DescriptionLong *DescriptionBlock }
func NewSectionGroup ¶
func NewSectionGroup(name string) *SectionGroup
NewRundownBlock returns a new RundownBlock node.
func (*SectionGroup) Dump ¶
func (n *SectionGroup) Dump(source []byte, level int)
func (*SectionGroup) Kind ¶
func (n *SectionGroup) Kind() goldast.NodeKind
Kind implements Node.Kind.
type SectionOption ¶
type SectionOption struct { goldast.BaseInline OptionName string OptionType OptionType OptionTypeString string OptionDescription string OptionPrompt null.String OptionDefault null.String OptionRequired bool OptionAs string }
func NewSectionOption ¶
func NewSectionOption(name string) *SectionOption
NewRundownBlock returns a new RundownBlock node.
func (*SectionOption) Dump ¶
func (n *SectionOption) Dump(source []byte, level int)
func (*SectionOption) Kind ¶
func (n *SectionOption) Kind() goldast.NodeKind
Kind implements Node.Kind.
type SectionPointer ¶
type SectionPointer struct { goldast.BaseBlock ConditionalImpl SectionName string StartNode goldast.Node Options []*SectionOption DescriptionShort string DescriptionLong *DescriptionBlock Silent bool ParentSection *SectionPointer Dependencies []*SectionPointer }
func FindParentSection ¶
func FindParentSection(heading goldast.Node) *SectionPointer
func FindSectionInDocument ¶
func FindSectionInDocument(parent goldast.Node, name string) *SectionPointer
func GetNextSection ¶
func GetNextSection(section *SectionPointer) *SectionPointer
Returns the next section in the AST for this Node.
func GetSectionForNode ¶
func GetSectionForNode(node goldast.Node) *SectionPointer
Locates the section this node is in.
func GetSections ¶
func GetSections(doc goldast.Node) []*SectionPointer
func NewSectionPointer ¶
func NewSectionPointer(name string) *SectionPointer
NewRundownBlock returns a new RundownBlock node.
func (*SectionPointer) AddOption ¶
func (n *SectionPointer) AddOption(option *SectionOption)
func (*SectionPointer) Dump ¶
func (n *SectionPointer) Dump(source []byte, level int)
func (*SectionPointer) FirstContentNode ¶
func (n *SectionPointer) FirstContentNode() goldast.Node
func (*SectionPointer) GetOption ¶
func (n *SectionPointer) GetOption(name string) *SectionOption
func (*SectionPointer) GetOptionByEnvName ¶
func (n *SectionPointer) GetOptionByEnvName(name string) *SectionOption
func (*SectionPointer) Kind ¶
func (n *SectionPointer) Kind() goldast.NodeKind
Kind implements Node.Kind.
func (*SectionPointer) ParseOptions ¶
func (*SectionPointer) ParseOptionsWithResolution ¶
func (*SectionPointer) ParseOptionsWithResolutionByName ¶
type SkipBlock ¶
type SkipBlock struct { goldast.BaseBlock ConditionalImpl Target goldast.Node }
func NewSkipBlock ¶
func NewSkipBlock() *SkipBlock
type SpinnerMode ¶
type SpinnerMode int
const ( SpinnerModeVisible SpinnerMode = iota SpinnerModeHidden SpinnerModeInlineAll SpinnerModeInlineFirst )
type StopFail ¶
type StopFail struct { goldast.BaseBlock ConditionalImpl }
type StopOk ¶
type StopOk struct { goldast.BaseBlock ConditionalImpl }
type SubEnvBlock ¶
func NewSubEnvBlock ¶
func NewSubEnvBlock(innerBlock goldast.Node) *SubEnvBlock
NewRundownBlock returns a new RundownBlock node.
func (*SubEnvBlock) Dump ¶
func (n *SubEnvBlock) Dump(source []byte, level int)
type TypeBoolean ¶
type TypeBoolean struct{}
func (*TypeBoolean) Describe ¶
func (t *TypeBoolean) Describe() string
func (*TypeBoolean) Normalise ¶
func (t *TypeBoolean) Normalise(input string) string
func (*TypeBoolean) Validate ¶
func (t *TypeBoolean) Validate(string) error
type TypeFilename ¶
func (*TypeFilename) Describe ¶
func (t *TypeFilename) Describe() string
func (*TypeFilename) Normalise ¶
func (t *TypeFilename) Normalise(input string) string
func (*TypeFilename) NormaliseToPath ¶
func (t *TypeFilename) NormaliseToPath(input string, pwd string) (string, error)
Takes the path provided in the option, and treats it as relative to the pwd, returning the absolute path.
func (*TypeFilename) Validate ¶
func (t *TypeFilename) Validate(string) error
type TypeString ¶
type TypeString struct{}
func (*TypeString) Describe ¶
func (t *TypeString) Describe() string
func (*TypeString) Normalise ¶
func (t *TypeString) Normalise(input string) string
func (*TypeString) Validate ¶
func (t *TypeString) Validate(string) error
Source Files ¶
- conditional_block.go
- copier.go
- description_block.go
- execution.go
- far_skip.go
- ignore.go
- import_block.go
- invisible_block.go
- invoke_block.go
- nav.go
- on_failure.go
- rundown_block.go
- save.go
- section_group.go
- section_option.go
- section_pointer.go
- skip_block.go
- stop_fail.go
- stop_ok.go
- subenv.go
- subenv_code_block.go