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 represented a job function from a mage file
func (Function) ExecCode ¶ added in v1.7.0
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) ID ¶ added in v1.7.0
ID returns user-readable information about where this function is defined.
func (Function) TargetName ¶ added in v1.7.0
TargetName returns the name of the target as it should appear when used from the mage cli. It is always lowercase.
type Functions ¶ added in v1.12.0
type Functions []*Function
Functions implements sort interface to optimize compiled output with deterministic generated mainfile.
type Import ¶ added in v1.8.0
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 ¶ added in v1.12.0
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.