Documentation
¶
Index ¶
- Constants
- Variables
- func ResolveClient(ctx context.Context) (client.Client, error)
- func ResolveSession(ctx context.Context, options ...ResolveSessionOption) (auth.Session, error)
- func RunWith(ctx context.Context, timeout time.Duration, action func(context.Context) error) error
- func SettingSources() setting.Sources
- type Flag
- type FlagName
- type ResolveSessionOption
Constants ¶
View Source
const DefaultTimeout = 45 * time.Second
Variables ¶
View Source
var ( SkipVersionCheckFlag = NewFlagForSetting[bool]("skip-version-check", setting.SkipVersionCheck) EndpointFlag = NewFlagForSetting[string]("endpoint", setting.Endpoint) WorkspaceFlag = NewFlagForSetting[string]("workspace", setting.Workspace) ProfileFlag = NewFlagForSetting[string]("profile", setting.Profile) )
View Source
var Version = devVersion
Version identifies the CLI to the meshStack API through the client's UserAgent. A release overrides it with -ldflags "-X github.com/meshcloud/meshstack-cli/cmd/internal.Version=<tag>".
Functions ¶
func ResolveClient ¶
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 ResolveSession ¶
func SettingSources ¶
Types ¶
type Flag ¶
type Flag[T string | bool] struct { Name FlagName Help string Value T // SettingEnvKey is required to use the Flag as a setting.FrontendSource. 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 nothing but its own name while the flag still carries the placeholder. The source is registered anyway, so setting resolution can name it in its error.
type ResolveSessionOption ¶
type ResolveSessionOption func(*auth.ResolveSessionOptions)
Click to show internal directories.
Click to hide internal directories.