Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PluginsMap = make(map[string]Plugin)
Functions ¶
func ClearPlugins ¶
func ClearPlugins()
func RegisterPlugin ¶
func RegisterPlugin(plugin Plugin)
Types ¶
type GenerateOpts ¶
type GenerateOpts struct { // full path name of the file where the command is being run. Path string // all the words being passed on the generate macro Words []string // name of the executable being run. if it is a go package, it will be the name of the cmd tool ExecutableName string // full path of the command being run. if it is a go package, this path will be an empty string ExecutablePath string // when this command is a "go run [pkg]" command, the name of the package being run GoPackage string // when this command is a "go run [pkg]@version" command, the version specified on it (e.g. 1.2.3, latest). Empty string when not specified. GoPackageVersion string // arguments being passed to the target executable. // examples: // [exec] -a -b arg -> ["-a", "-b", "arg"] // go run [pkg] -a -b arg -> ["-a", "-b", "cmd"] SanitizedArgs []string // optionally added input files before the command ExtraInputPatterns []string // optionally added output files before the command ExtraOutputPatterns []string }
func (*GenerateOpts) Command ¶
func (g *GenerateOpts) Command() string
func (*GenerateOpts) Dir ¶
func (g *GenerateOpts) Dir() string
full dir where the command is being run on. this is the os.Getwd() when the plugins are running
func (*GenerateOpts) File ¶
func (g *GenerateOpts) File() string
base name of the file containing the command.
type InputOutputFiles ¶
type Plugin ¶
type Plugin interface { Name() string Matches(opts GenerateOpts) bool ComputeInputOutputFiles(opts GenerateOpts) *InputOutputFiles }
func MatchPlugin ¶
func MatchPlugin(opts GenerateOpts) Plugin
Click to show internal directories.
Click to hide internal directories.