Documentation
¶
Index ¶
- func CmdWithEnv(cmd *cobra.Command, f func(context.Context, cfg.Context, []string) error) *cobra.Command
- func ConsoleToSink(out *os.File, isTerm bool) (tasks.ActionSink, colors.Style, func())
- func DefaultErrorFormatter(out io.Writer, style colors.Style, err error)
- func DeferCheckVersion(ctx context.Context, command string)
- func DoMain(name string, autoUpdate bool, formatErr FormatErrorFunc, ...)
- func EnvFromValue(cmd *cobra.Command, env *string) *cfg.Context
- func ListenPProf(debugSink io.Writer)
- func PushParse(cmd *cobra.Command, handler func(ctx context.Context, args []string) error)
- func PushPreParse(cmd *cobra.Command, handler func(ctx context.Context, args []string) error)
- func RegisterPprof(r *mux.Router)
- func RunE(handler CmdHandler) func(*cobra.Command, []string) error
- func RunInContext(ctx context.Context, handler func(context.Context) error) error
- func SetupContext(ctx context.Context) (context.Context, colors.Style, func())
- func SetupViper()
- func StandardConsole() (*os.File, bool)
- func With(cmd *cobra.Command, handler func(context.Context) error) *cobra.Command
- func WithSigIntCancel(ctx context.Context) (context.Context, func())
- type ArgsParser
- type CmdHandler
- type CommandCtrl
- type FormatErrorFunc
- type Locations
- type LocationsParser
- type ParseLocationsOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CmdWithEnv ¶
func CmdWithEnv(cmd *cobra.Command, f func(context.Context, cfg.Context, []string) error) *cobra.Command
Deprecated, use "ParseEnv"/"FixedEnv" instead.
func ConsoleToSink ¶
func DefaultErrorFormatter ¶ added in v0.0.215
func DeferCheckVersion ¶ added in v0.0.164
func DoMain ¶
func DoMain(name string, autoUpdate bool, formatErr FormatErrorFunc, registerCommands func(*cobra.Command))
func EnvFromValue ¶ added in v0.0.135
func ListenPProf ¶
func PushPreParse ¶ added in v0.0.164
func RegisterPprof ¶
func RunInContext ¶ added in v0.0.111
func SetupContext ¶ added in v0.0.84
func SetupViper ¶
func SetupViper()
func StandardConsole ¶
Types ¶
type ArgsParser ¶
type ArgsParser interface { AddFlags(*cobra.Command) Parse(ctx context.Context, args []string) error }
func HardcodeEnv ¶
func HardcodeEnv(envOut *cfg.Context, env string) ArgsParser
HardcodeEnv is a temporary facility to trigger context loading with a predefined environment name.
func ParseEnv ¶
func ParseEnv(envOut *cfg.Context) ArgsParser
type CommandCtrl ¶
type CommandCtrl struct {
// contains filtered or unexported fields
}
func Cmd ¶
func Cmd(cmd *cobra.Command) *CommandCtrl
func (*CommandCtrl) DoWithArgs ¶
func (c *CommandCtrl) DoWithArgs(handler CmdHandler) *cobra.Command
func (*CommandCtrl) With ¶
func (c *CommandCtrl) With(argParser ...ArgsParser) *CommandCtrl
func (*CommandCtrl) WithFlags ¶
func (c *CommandCtrl) WithFlags(f func(flags *pflag.FlagSet)) *CommandCtrl
type Locations ¶
type Locations struct { Locations []fnfs.Location Refs []*schema.PackageRef Root *parsing.Root // Whether the user explicitly specified a list of locations. // If true, "All" can be not empty if "DefaultToAllWhenEmpty" is true UserSpecified bool }
func LocationsFromArgs ¶ added in v0.0.135
type LocationsParser ¶
type LocationsParser struct {
// contains filtered or unexported fields
}
func ParseLocations ¶
func ParseLocations(locsOut *Locations, env *cfg.Context, opts ...ParseLocationsOpts) *LocationsParser
func (*LocationsParser) AddFlags ¶
func (p *LocationsParser) AddFlags(cmd *cobra.Command)
type ParseLocationsOpts ¶
type ParseLocationsOpts struct { // Verify that exactly one location is specified. RequireSingle bool // If true, and no locations are specified, then "workspace.ListSchemas" result is used. ReturnAllIfNoneSpecified bool // If true, package reference added to Refs SupportPackageRef bool }
func MergeParseLocationOpts ¶ added in v0.0.84
func MergeParseLocationOpts(opts []ParseLocationsOpts) ParseLocationsOpts
Source Files
¶
Click to show internal directories.
Click to hide internal directories.