Documentation
¶
Overview ¶
Package launchcfg owns the provider-facing part of launch configuration that every Golder front-end shares. It deliberately stops before run assembly: the CLI, TUI and GUI may build different views, but they must agree on flag/file precedence and on where a credential came from.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Changed ¶
Changed reports whether a command-line flag was explicitly supplied. A nil function means no flag was supplied, which is what a settings-only GUI uses.
type CredentialResult ¶
type CredentialResult struct {
Status CredentialStatus
Warnings []string
// contains filtered or unexported fields
}
CredentialResult is the launch-time credential resolution. A value is returned only for an explicit value or a successfully loaded named reference; ambient environment credentials stay ambient and are read by CredentialStore.
func ResolveCredential ¶
func ResolveCredential(providerName, apiKey, credentialRef string) CredentialResult
ResolveCredential applies the shared static credential precedence: explicit/config api_key > named credential > inherited provider environment. A broken named reference warns and falls through to the environment, matching the CLI's historical behavior.
func (CredentialResult) ResolvedValue ¶
func (r CredentialResult) ResolvedValue() string
ResolvedValue returns the launch-only secret for passing into the provider store. Callers must not display or persist it.
type CredentialSource ¶
type CredentialSource string
CredentialSource is safe display metadata. It never contains the credential.
const ( CredentialMissing CredentialSource = "missing" CredentialExplicit CredentialSource = "explicit" CredentialNamed CredentialSource = "named" CredentialEnvironment CredentialSource = "environment" )
type CredentialStatus ¶
type CredentialStatus struct {
Available bool
Source CredentialSource
// Name is the named-credential reference when Source is named.
Name string
// EnvVar is the inherited environment variable when Source is environment.
EnvVar string
}
CredentialStatus tells a UI whether authentication is available and where it came from, without revealing a value.
type Values ¶
type Values struct {
Model string
Provider string
BaseURL string
Protocol string
APIKey string
CredentialRef string
ThinkingLevel string
}
Values is the provider-facing launch state after defaults but before the config file is overlaid. APIKey is secret and must never be formatted or logged; the other fields are ordinary settings.
func Overlay ¶
func Overlay(v Values, cfg config.FileConfig, changed Changed) Values
Overlay applies the shared CLI > config.toml > built-in precedence for the provider-facing fields. A literal api_key wins over a named reference for backward compatibility, but new writers should save only CredentialRef.