Documentation
¶
Index ¶
- func FallbackLookupSource(matchingEnvKey, description string, ...) setting.FallbackSource
- func LookupSource(matchingEnvKey, description string, ...) setting.FrontendSource
- func ResolveWorkspace(ctx context.Context, sources Sources) (string, error)
- func WorkspacesFromContext(ctx context.Context) (meshstack.Workspaces, error)
- type FallbackSource
- type FrontendSource
- type MeshWorkspace
- type Setting
- type Sources
- type Workspaces
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FallbackLookupSource ¶
func FallbackLookupSource(matchingEnvKey, description string, lookup func(ctx context.Context) (string, error)) setting.FallbackSource
FallbackLookupSource is a LookupSource that ranks below the environment instead of above it.
func LookupSource ¶
func LookupSource(matchingEnvKey, description string, lookup func(ctx context.Context) (string, error)) setting.FrontendSource
LookupSource builds a source for one setting that ranks above the environment. The lookup runs only when the resolution reaches it, so it may prompt or call the backend.
func ResolveWorkspace ¶ added in v0.2.0
ResolveWorkspace resolves Workspace from sources and the environment, and is empty when neither names one. A profile's default workspace is no source here, unlike in a session.
func WorkspacesFromContext ¶
func WorkspacesFromContext(ctx context.Context) (meshstack.Workspaces, error)
WorkspacesFromContext returns the workspaces the credential can see. They are only in the context while Workspace is being resolved, so a lookup for any other setting gets an error.
Types ¶
type FallbackSource ¶
type FallbackSource = setting.FallbackSource
FallbackSource ranks below the environment, as a prompt does.
type FrontendSource ¶
type FrontendSource = setting.FrontendSource
FrontendSource outranks the environment, as a flag or a block attribute does.
type MeshWorkspace ¶
type MeshWorkspace = meshstack.MeshWorkspace
MeshWorkspace is one workspace, and its String is what a person picks from.
type Setting ¶
Setting is one declared input, identified by its environment variable key.
var ( Endpoint Setting = meshstack.EndpointSetting Workspace Setting = meshstack.WorkspaceSetting SkipVersionCheck Setting = meshstack.SkipVersionCheckSetting Profile Setting = profile.NameSetting ApiKeyClientId Setting = auth.ApiKeyClientIdSetting ApiKeyClientSecret Setting = auth.ApiKeyClientSecretSetting ApiToken Setting = auth.ApiTokenSetting )
The settings a front end may supply through a FrontendSource.
type Sources ¶
Sources are the setting sources a front end contributes to every resolution.
func SingleSource ¶
SingleSource wraps one source as the front end's only contribution, ranking it above the environment and the default.
type Workspaces ¶
type Workspaces = meshstack.Workspaces
Workspaces are the workspaces reachable while resolving Workspace, see WorkspacesFromContext.