Documentation
¶
Index ¶
- Constants
- func AddAllFlags(fset *flag.FlagSet) (debug *bool, projectDir *string, godelConfig *string, config *string)
- func AddAllFlagsPtrs(fset *flag.FlagSet, debug *bool, projectDir *string, godelConfig *string, ...)
- func AddAllPFlags(fset *pflag.FlagSet) (debug *bool, projectDir *string, godelConfig *string, config *string, ...)
- func AddAllPFlagsPtrs(fset *pflag.FlagSet, debug *bool, projectDir *string, godelConfig *string, ...)
- func AddAssetsPFlag(fset *pflag.FlagSet) *[]string
- func AddAssetsPFlagPtr(fset *pflag.FlagSet, assets *[]string)
- func AddConfigFlag(fset *flag.FlagSet) *string
- func AddConfigFlagPtr(fset *flag.FlagSet, config *string)
- func AddConfigPFlag(fset *pflag.FlagSet) *string
- func AddConfigPFlagPtr(fset *pflag.FlagSet, config *string)
- func AddDebugFlag(fset *flag.FlagSet) *bool
- func AddDebugFlagPtr(fset *flag.FlagSet, debug *bool)
- func AddDebugPFlag(fset *pflag.FlagSet) *bool
- func AddDebugPFlagPtr(fset *pflag.FlagSet, debug *bool)
- func AddGodelConfigFlag(fset *flag.FlagSet) *string
- func AddGodelConfigFlagPtr(fset *flag.FlagSet, godelConfig *string)
- func AddGodelConfigPFlag(fset *pflag.FlagSet) *string
- func AddGodelConfigPFlagPtr(fset *pflag.FlagSet, godelConfig *string)
- func AddProjectDirFlag(fset *flag.FlagSet) *string
- func AddProjectDirFlagPtr(fset *flag.FlagSet, projectDir *string)
- func AddProjectDirPFlag(fset *pflag.FlagSet) *string
- func AddProjectDirPFlagPtr(fset *pflag.FlagSet, projectDir *string)
- func CobraInfoCmd(info PluginInfo) *cobra.Command
- func CobraUpgradeConfigCmd(upgradeFn UpgradeConfigFn) *cobra.Command
- func InfoCmd(osArgs []string, stdout io.Writer, info PluginInfo) bool
- type GlobalFlagOptions
- type GlobalFlagOptionsParam
- func GlobalFlagOptionsParamConfigFlag(configFlag string) GlobalFlagOptionsParam
- func GlobalFlagOptionsParamDebugFlag(debugFlag string) GlobalFlagOptionsParam
- func GlobalFlagOptionsParamGodelConfigFlag(godelConfigFlag string) GlobalFlagOptionsParam
- func GlobalFlagOptionsParamProjectDirFlag(projectDirFlag string) GlobalFlagOptionsParam
- type PluginInfo
- func InfoFromBytes(infoBytes []byte) (PluginInfo, error)
- func InfoFromPlugin(pluginPath string) (PluginInfo, error)
- func MustNewPluginInfo(group, product, version string, params ...PluginInfoParam) PluginInfo
- func NewPluginInfo(group, product, version string, params ...PluginInfoParam) (PluginInfo, error)
- type PluginInfoParam
- type SchemaVersion
- type TaskInfo
- type TaskInfoParam
- type UpgradeConfigFn
- type VerifyFlag
- type VerifyOptions
- type VerifyOptionsParam
Constants ¶
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" )
const ( CurrentSchemaVersion = "1" PluginInfoCommandName = "_godelPluginInfo" )
Variables ¶
This section is empty.
Functions ¶
func AddAllFlags ¶
func AddAllFlagsPtrs ¶
func AddAllPFlags ¶
func AddAllPFlagsPtrs ¶
func AddAssetsPFlag ¶
func AddAssetsPFlagPtr ¶
func AddConfigFlag ¶
func AddConfigFlagPtr ¶
func AddConfigPFlag ¶
func AddConfigPFlagPtr ¶
func AddDebugFlag ¶
func AddDebugFlagPtr ¶
func AddDebugPFlag ¶
func AddDebugPFlagPtr ¶
func AddGodelConfigFlag ¶
func AddGodelConfigFlagPtr ¶
func AddGodelConfigPFlag ¶
func AddGodelConfigPFlagPtr ¶
func AddProjectDirFlag ¶
func AddProjectDirFlagPtr ¶
func AddProjectDirPFlag ¶
func AddProjectDirPFlagPtr ¶
func CobraInfoCmd ¶
func CobraInfoCmd(info PluginInfo) *cobra.Command
func CobraUpgradeConfigCmd ¶
func CobraUpgradeConfigCmd(upgradeFn UpgradeConfigFn) *cobra.Command
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.
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 PluginInfo ¶
type PluginInfo 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. Empty string means that no // configuration file is used. 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 }
PluginInfo specifies the information for a plugin and the tasks that it provides.
func InfoFromBytes ¶
func InfoFromBytes(infoBytes []byte) (PluginInfo, error)
func InfoFromPlugin ¶
func InfoFromPlugin(pluginPath string) (PluginInfo, 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 MustNewPluginInfo ¶
func MustNewPluginInfo(group, product, version string, params ...PluginInfoParam) PluginInfo
MustNewPluginInfo returns the result of calling NewInfo with the provided parameters. Panics if the call to NewPluginInfo returns an error, so this function should only be used when the inputs are static and known to be valid.
func NewPluginInfo ¶
func NewPluginInfo(group, product, version string, params ...PluginInfoParam) (PluginInfo, error)
NewPluginInfo creates a new PluginInfo 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 or if a task is not valid).
type PluginInfoParam ¶
type PluginInfoParam interface {
// contains filtered or unexported methods
}
func PluginInfoGlobalFlagOptions ¶
func PluginInfoGlobalFlagOptions(params ...GlobalFlagOptionsParam) PluginInfoParam
func PluginInfoTaskInfo ¶
func PluginInfoTaskInfo(name, description string, params ...TaskInfoParam) PluginInfoParam
func PluginInfoUsesConfigFile ¶
func PluginInfoUsesConfigFile() PluginInfoParam
type SchemaVersion ¶
type SchemaVersion struct {
PluginSchemaVersionVar string `json:"pluginSchemaVersion"`
}
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.
type TaskInfoParam ¶
type TaskInfoParam interface {
// contains filtered or unexported methods
}
func TaskInfoCommand ¶
func TaskInfoCommand(command ...string) TaskInfoParam
func TaskInfoVerifyOptions ¶
func TaskInfoVerifyOptions(params ...VerifyOptionsParam) TaskInfoParam
type UpgradeConfigFn ¶
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.
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