parse

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2018 License: Apache-2.0 Imports: 13 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableDebug added in v1.4.0

func EnableDebug()

EnableDebug turns on debug logging.

Types

type Function

type Function struct {
	PkgAlias   string
	Package    string
	ImportPath string
	Name       string
	Receiver   string
	IsError    bool
	IsContext  bool
	Synopsis   string
	Comment    string
}

Function represented a job function from a mage file

func (Function) ExecCode added in v1.7.0

func (f Function) ExecCode() (string, error)

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

func (f Function) ID() string

ID returns user-readable information about where this function is defined.

func (Function) TargetName added in v1.7.0

func (f Function) TargetName() string

TargetName returns the name of the target as it should appear when used from the mage cli. It is always lowercase.

type PkgInfo

type PkgInfo struct {
	Description string
	Funcs       []*Function
	DefaultFunc *Function
	Aliases     map[string]*Function
	Imports     map[string]string
	RootImports []string
}

PkgInfo contains inforamtion about a package of files according to mage's parsing rules.

func Package

func Package(path string, files []string) (*PkgInfo, error)

Package parses a package. If files is non-empty, it will only parse the files given.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL