Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Function ¶
type Function struct {
PkgAlias string
Package string
ImportPath string
Name string
Receiver string
IsError bool
IsContext bool
Synopsis string
Comment string
Args []Arg
}
Function represents a job function from a mage file
func (Function) ExecCode ¶
ExecCode returns code for the template switch to run the target. It wraps each target call to match the func(context.Context) error that runTarget requires.
func (Function) TargetName ¶
TargetName returns the name of the target as it should appear when used from the mage cli. It is always lowercase.
type Functions ¶
type Functions []*Function
Functions implements sort interface to optimize compiled output with deterministic generated mainfile.
type Import ¶
type Import struct {
Alias string
Name string
UniqueName string // a name unique across all imports
Path string
Info PkgInfo
}
Import represents the data about a mage:import package
type Imports ¶
type Imports []*Import
Imports implements sort interface to optimize compiled output with deterministic generated mainfile.
type PkgInfo ¶
type PkgInfo struct {
AstPkg *ast.Package
DocPkg *doc.Package
Description string
Funcs Functions
DefaultFunc *Function
Aliases map[string]*Function
Imports Imports
}
PkgInfo contains inforamtion about a package of files according to mage's parsing rules.