Documentation
¶
Index ¶
- Variables
- func First[T any](items iter.Seq2[T, error], n int) iter.Seq2[T, error]
- func ListWorkspace(ctx context.Context) (*string, error)
- func ResolveClient(ctx context.Context, modifiers ...ResolveClientOptionsModifier) (client.Client, error)
- func ResolveClientOptions(modifiers ...ResolveClientOptionsModifier) (opts auth.ResolveClientOptions)
- func SettingSources() setting.Sources
- func SkipVersionCheck(opts *auth.ResolveClientOptions)
- func UuidArg(id *uuid.UUID) cobra.PositionalArgs
- type ExitError
- type Flag
- type FlagName
- type KindCommand
- type LimitFlag
- type ListFlags
- type ListResult
- type OutputFlag
- type OutputFormat
- type ResolveClientOptionsModifier
- type ShowFlag
- type UuidFlag
Constants ¶
This section is empty.
Variables ¶
var ( SkipVersionCheckFlag = NewFlagForSetting[bool]("skip-version-check", setting.SkipVersionCheck) EndpointFlag = NewFlagForSetting[string]("endpoint", setting.Endpoint) WorkspaceFlag = NewFlagForSetting[string]("workspace", setting.Workspace).WithShorthand("w") ProfileFlag = NewFlagForSetting[string]("profile", setting.Profile).WithShorthand("p") )
var Version = devVersion
Version is set with -X by its package path in .goreleaser.yml, the Dockerfile and flake.nix, so moving or renaming it needs the same change there. The linker ignores an -X that does not resolve.
Functions ¶
func ListWorkspace ¶ added in v0.2.0
ListWorkspace is the workspace the session works in, which a listing keeps to as every other command does, and nil where the session works in none.
func ResolveClient ¶
func ResolveClient(ctx context.Context, modifiers ...ResolveClientOptionsModifier) (client.Client, error)
ResolveClient is the only place a client is built, so every command sends the same user agent and resolves the same global flags as settings.
func ResolveClientOptions ¶ added in v0.2.0
func ResolveClientOptions(modifiers ...ResolveClientOptionsModifier) (opts auth.ResolveClientOptions)
func SettingSources ¶
func SkipVersionCheck ¶ added in v0.3.0
func SkipVersionCheck(opts *auth.ResolveClientOptions)
SkipVersionCheck is for a call whose failure only leaves something out: the version checks call meshStack and GitHub, and warn where they fail.
Types ¶
type ExitError ¶ added in v0.3.0
ExitError makes cmd/meshstack exit with Code rather than 1, such as the exit code of a command it ran.
type Flag ¶
type Flag[T string | bool | uuid.UUID] struct { Name FlagName Shorthand string Help string Value T SettingEnvKey string }
func NewFlagForSetting ¶
func (*Flag[T]) AsSource ¶
func (flag *Flag[T]) AsSource() setting.FrontendSource
func (*Flag[T]) AsSourceUnless ¶
func (flag *Flag[T]) AsSourceUnless(predicate func(T) bool) setting.FrontendSource
AsSourceUnless contributes no value while predicate holds, but stays a source, so that setting resolution can still name the flag in an error.
func (Flag[T]) WithShorthand ¶ added in v0.3.0
type KindCommand ¶ added in v0.3.0
type KindCommand string
func KindCommandOf ¶ added in v0.3.0
func KindCommandOf(name string) KindCommand
func (KindCommand) Aliases ¶ added in v0.3.0
func (command KindCommand) Aliases() []string
func (KindCommand) Long ¶ added in v0.3.0
func (command KindCommand) Long(short string) string
type ListFlags ¶ added in v0.2.0
type ListFlags struct {
// contains filtered or unexported fields
}
func (*ListFlags) RunSeq ¶ added in v0.3.0
func (f *ListFlags) RunSeq(cmd *cobra.Command, list func(ctx context.Context, meshStack client.Client, options client.ListOptions) iter.Seq2[jsontext.Value, error]) error
RunSeq is Run for a listing that is not one kind's, such as the runs of every building block.
type ListResult ¶ added in v0.3.0
func (ListResult) CutShortNote ¶ added in v0.3.0
func (r ListResult) CutShortNote() string
type OutputFlag ¶ added in v0.2.0
type OutputFlag struct{ Format OutputFormat }
OutputFlag implements pflag.Value, so an unknown format is rejected while the flags are parsed rather than after the first page arrived.
func (*OutputFlag) Register ¶ added in v0.2.0
func (f *OutputFlag) Register(flags *pflag.FlagSet)
func (*OutputFlag) RegisterForItem ¶ added in v0.3.0
func (f *OutputFlag) RegisterForItem(flags *pflag.FlagSet)
RegisterForItem is Register for a command that writes one object through OutputFormat.WriteItem.
func (*OutputFlag) Set ¶ added in v0.2.0
func (f *OutputFlag) Set(value string) error
func (*OutputFlag) String ¶ added in v0.2.0
func (f *OutputFlag) String() string
func (*OutputFlag) Type ¶ added in v0.2.0
func (f *OutputFlag) Type() string
type OutputFormat ¶ added in v0.2.0
type OutputFormat string
const ( OutputJson OutputFormat = "json" OutputNdjson OutputFormat = "ndjson" OutputMarkdown OutputFormat = "markdown" )
type ResolveClientOptionsModifier ¶ added in v0.3.0
type ResolveClientOptionsModifier func(*auth.ResolveClientOptions)
func WithSettingSources ¶ added in v0.3.0
func WithSettingSources(sources setting.Sources) ResolveClientOptionsModifier
type ShowFlag ¶ added in v0.3.0
type ShowFlag struct{ Format OutputFormat }
func (*ShowFlag) Json ¶ added in v0.3.0
Json output is read by a script, so a command must not prompt for anything then.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package color decides how much color the CLI writes, so that the Markdown a command shows and the log agree.
|
Package color decides how much color the CLI writes, so that the Markdown a command shows and the log agree. |
|
Package prompt asks a person on the terminal.
|
Package prompt asks a person on the terminal. |