pluginapi

package
v2.0.0-rc2+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2018 License: Apache-2.0 Imports: 14 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// DebugFlagName is the name of the boolean flag that will be provided as "--<DebugFlagName>" if "debug" is true.
	DebugFlagName = "debug"
	// ProjectDirFlagName is the name of the string flag that is provided as "--<ProjectDirFlagName> <dir>", where
	// "<dir>" is the
	// path to the project directory.
	ProjectDirFlagName = "project-dir"
	// GodelConfigFlagName is the name of the string flag that is provided as "--<GodelConfigFlagName> <config>", where
	// "<config>" is the path to the configuration file for gödel.
	GodelConfigFlagName = "godel-config"
	// ConfigFlagName is the name of the string flag that is provided as "--<ConfigFlagName> <config>", where "<config>"
	// is the path to the configuration file for the plugin.
	ConfigFlagName = "config"
	// AssetsFlagName is the name of the assets flag that is provided as "--<AssetsFlagName> <assets>", where "<assets>"
	// is a comma-delimited list of the paths to the assets for the plugin.
	AssetsFlagName = "assets"
)
View Source
const (
	CurrentSchemaVersion = "1"
	InfoCommandName      = "_godelPluginInfo"
)

Variables

This section is empty.

Functions

func AddAllFlags

func AddAllFlags(fset *flag.FlagSet) (debug *bool, projectDir *string, godelConfig *string, config *string)

func AddAllFlagsPtrs

func AddAllFlagsPtrs(fset *flag.FlagSet, debug *bool, projectDir *string, godelConfig *string, config *string)

func AddAllPFlags

func AddAllPFlags(fset *pflag.FlagSet) (debug *bool, projectDir *string, godelConfig *string, config *string, assets *[]string)

func AddAllPFlagsPtrs

func AddAllPFlagsPtrs(fset *pflag.FlagSet, debug *bool, projectDir *string, godelConfig *string, config *string, assets *[]string)

func AddAssetsPFlag

func AddAssetsPFlag(fset *pflag.FlagSet) *[]string

func AddAssetsPFlagPtr

func AddAssetsPFlagPtr(fset *pflag.FlagSet, assets *[]string)

func AddConfigFlag

func AddConfigFlag(fset *flag.FlagSet) *string

func AddConfigFlagPtr

func AddConfigFlagPtr(fset *flag.FlagSet, config *string)

func AddConfigPFlag

func AddConfigPFlag(fset *pflag.FlagSet) *string

func AddConfigPFlagPtr

func AddConfigPFlagPtr(fset *pflag.FlagSet, config *string)

func AddDebugFlag

func AddDebugFlag(fset *flag.FlagSet) *bool

func AddDebugFlagPtr

func AddDebugFlagPtr(fset *flag.FlagSet, debug *bool)

func AddDebugPFlag

func AddDebugPFlag(fset *pflag.FlagSet) *bool

func AddDebugPFlagPtr

func AddDebugPFlagPtr(fset *pflag.FlagSet, debug *bool)

func AddGodelConfigFlag

func AddGodelConfigFlag(fset *flag.FlagSet) *string

func AddGodelConfigFlagPtr

func AddGodelConfigFlagPtr(fset *flag.FlagSet, godelConfig *string)

func AddGodelConfigPFlag

func AddGodelConfigPFlag(fset *pflag.FlagSet) *string

func AddGodelConfigPFlagPtr

func AddGodelConfigPFlagPtr(fset *pflag.FlagSet, godelConfig *string)

func AddProjectDirFlag

func AddProjectDirFlag(fset *flag.FlagSet) *string

func AddProjectDirFlagPtr

func AddProjectDirFlagPtr(fset *flag.FlagSet, projectDir *string)

func AddProjectDirPFlag

func AddProjectDirPFlag(fset *pflag.FlagSet) *string

func AddProjectDirPFlagPtr

func AddProjectDirPFlagPtr(fset *pflag.FlagSet, projectDir *string)

func CobraInfoCmd

func CobraInfoCmd(info Info) *cobra.Command

func InfoCmd

func InfoCmd(osArgs []string, stdout io.Writer, info Info) bool

Types

type GlobalFlagOptions

type GlobalFlagOptions interface {
	DebugFlag() string
	ProjectDirFlag() string
	GodelConfigFlag() string
	ConfigFlag() string
	// contains filtered or unexported methods
}

GlobalFlagOptions is a JSON-serializable interface that can be translated into a godellauncher.GlobalFlagOptions. See godellauncher.GlobalFlagOptions for documentation.

func NewGlobalFlagOptions

func NewGlobalFlagOptions(params ...GlobalFlagOptionsParam) GlobalFlagOptions

type GlobalFlagOptionsParam

type GlobalFlagOptionsParam interface {
	// contains filtered or unexported methods
}

func GlobalFlagOptionsParamConfigFlag

func GlobalFlagOptionsParamConfigFlag(configFlag string) GlobalFlagOptionsParam

func GlobalFlagOptionsParamDebugFlag

func GlobalFlagOptionsParamDebugFlag(debugFlag string) GlobalFlagOptionsParam

func GlobalFlagOptionsParamGodelConfigFlag

func GlobalFlagOptionsParamGodelConfigFlag(godelConfigFlag string) GlobalFlagOptionsParam

func GlobalFlagOptionsParamProjectDirFlag

func GlobalFlagOptionsParamProjectDirFlag(projectDirFlag string) GlobalFlagOptionsParam

type Info

type Info interface {
	// PluginSchemaVersion returns the schema version for the plugin.
	PluginSchemaVersion() string
	// ID returns the identifier for a plugin and is a string of the form "group:product:version".
	ID() string
	// ConfigFileName returns the name of the configuration file used by the plugin.
	ConfigFileName() string
	// Tasks returns the tasks provided by the plugin. Requires the path to the plugin executable and assets as input.
	Tasks(pluginExecPath string, assets []string) []godellauncher.Task
	// contains filtered or unexported methods
}

Info specifies the information for a plugin and the tasks that it provides.

func InfoFromPlugin

func InfoFromPlugin(pluginPath string) (Info, error)

InfoFromPlugin returns the Info for the plugin at the specified path. Does so by invoking the InfoCommand on the plugin and parsing the output.

func MustNewInfo

func MustNewInfo(group, product, version, configFileName string, tasks ...TaskInfo) Info

MustNewInfo returns the result of calling NewInfo with the provided parameters. Panics if the call to NewInfo returns an error, so this function should only be used when the inputs are static and known to be valid.

func NewInfo

func NewInfo(group, product, version, configFileName string, tasks ...TaskInfo) (Info, error)

NewInfo creates a new Info for the plugin using the provided configuration. Returns an error if the provided configuration is not valid (can occur if multiple tasks have the same name).

type TaskInfo

type TaskInfo interface {
	Name() string
	Description() string
	Command() []string
	GlobalFlagOptions() GlobalFlagOptions
	VerifyOptions() VerifyOptions
	// contains filtered or unexported methods
}

TaskInfo is a JSON-serializable interface that can be translated into a godellauncher.Task. Refer to that struct for field documentation.

func MustNewTaskInfo

func MustNewTaskInfo(name, description string, params ...TaskInfoParam) TaskInfo

func NewTaskInfo

func NewTaskInfo(name, description string, params ...TaskInfoParam) (TaskInfo, error)

type TaskInfoParam

type TaskInfoParam interface {
	// contains filtered or unexported methods
}

func TaskInfoCommand

func TaskInfoCommand(command ...string) TaskInfoParam

func TaskInfoGlobalFlagOptions

func TaskInfoGlobalFlagOptions(globalFlagOpts GlobalFlagOptions) TaskInfoParam

func TaskInfoVerifyOptions

func TaskInfoVerifyOptions(verifyOpts VerifyOptions) TaskInfoParam

type VerifyFlag

type VerifyFlag interface {
	Name() string
	Description() string
	Type() godellauncher.FlagType
	// contains filtered or unexported methods
}

VerifyFlag is a JSON-serializable interface that can be translated into a godellauncher.VerifyFlag. Refer to that struct for field documentation.

func NewVerifyFlag

func NewVerifyFlag(name, description string, typ godellauncher.FlagType) VerifyFlag

type VerifyOptions

type VerifyOptions interface {
	VerifyTaskFlags() []VerifyFlag
	Ordering() *int
	ApplyTrueArgs() []string
	ApplyFalseArgs() []string
	// contains filtered or unexported methods
}

VerifyOptions is a JSON-serializable interface that can be translated into a godellauncher.VerifyOptions. Refer to that struct for field documentation.

func NewVerifyOptions

func NewVerifyOptions(params ...VerifyOptionsParam) VerifyOptions

type VerifyOptionsParam

type VerifyOptionsParam interface {
	// contains filtered or unexported methods
}

func VerifyOptionsApplyFalseArgs

func VerifyOptionsApplyFalseArgs(args ...string) VerifyOptionsParam

func VerifyOptionsApplyTrueArgs

func VerifyOptionsApplyTrueArgs(args ...string) VerifyOptionsParam

func VerifyOptionsOrdering

func VerifyOptionsOrdering(ordering *int) VerifyOptionsParam

func VerifyOptionsTaskFlags

func VerifyOptionsTaskFlags(flags ...VerifyFlag) VerifyOptionsParam

Jump to

Keyboard shortcuts

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