Documentation
¶
Overview ¶
Package config parses and composes the first-slice Wirecmd configuration.
Index ¶
- type AgeIdentity
- type AgeSecrets
- type AgeSecretsSource
- type Config
- type Environment
- type HTTP
- type HTTPField
- type HTTPSource
- type HTTPTransportKind
- type LSP
- type LSPSelector
- type LSPSource
- type OAuth
- type OAuthSource
- type Provenance
- type ResolvedValue
- type Root
- type Scope
- type Secrets
- type SecretsSource
- type Server
- type ServerSource
- type Source
- type Stdio
- type StdioSource
- type Value
- type ValueKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgeIdentity ¶ added in v0.4.0
type AgeIdentity struct {
Path string
Provenance
}
AgeIdentity identifies one user-managed age identity file.
type AgeSecrets ¶ added in v0.4.0
type AgeSecrets struct {
Identities []AgeIdentity
Provenance Provenance
}
AgeSecrets configures the fixed age executable's identity files.
type AgeSecretsSource ¶ added in v0.4.0
type AgeSecretsSource struct {
Identities []AgeIdentity
Provenance Provenance
}
AgeSecretsSource is a potentially partial age configuration layer. A non-empty identity list replaces weaker lists during composition.
type Config ¶
Config is the complete source-syntax-independent configuration model consumed by execution.
func Compose ¶
Compose combines sources from weakest to strongest and validates the effective result. Scalars use the strongest present value. Named servers and environment entries retain first-introduction order while later sources replace matching entries.
func LoadEffective ¶
LoadEffective loads paths from weakest to strongest, composes their partial sources, and validates the resulting complete configuration.
func LoadEffectiveDiscovered ¶
LoadEffectiveDiscovered validates workspace .wirecmd/config.kdl files without changing the behavior of trusted global or explicitly supplied files.
type Environment ¶
type Environment struct {
Name string
Value Value
Provenance
}
Environment assigns a value to a child process environment name.
type HTTP ¶
type HTTP struct {
Kind HTTPTransportKind
Endpoint string
EndpointProvenance Provenance
Query []HTTPField
Headers []HTTPField
OAuth *OAuth
Provenance
}
HTTP describes one complete HTTP-family transport.
type HTTPField ¶
type HTTPField struct {
Name string
Value Value
Provenance
}
HTTPField is one named HTTP query or header value. Name retains the spelling from the source while composition uses the appropriate case-sensitivity for the field collection.
type HTTPSource ¶
type HTTPSource struct {
Kind HTTPTransportKind
Endpoint *string
EndpointProvenance Provenance
Query []HTTPField
Headers []HTTPField
OAuth *OAuthSource
Provenance
}
HTTPSource is a potentially partial HTTP-family transport layer. A present source selects its transport even when it omits the endpoint to inherit one from a weaker layer of the same kind.
type HTTPTransportKind ¶ added in v0.3.0
type HTTPTransportKind string
HTTPTransportKind identifies the protocol carried by an HTTP endpoint. Its zero value is Streamable HTTP so existing programmatic HTTP configuration remains compatible.
const ( HTTPTransportHTTP HTTPTransportKind = "" HTTPTransportSSE HTTPTransportKind = "sse" )
type LSP ¶
type LSP struct {
Name string
Scope Scope
ScopeProvenance Provenance
ImplementationID string
ImplementationIDProvenance Provenance
Selectors []LSPSelector
Stdio Stdio
Provenance
}
LSP is a named complete local language-server definition. Its name is a configuration and instance identity; routine LSP operations select matching effective workspace definitions rather than exposing a name as an argument.
type LSPSelector ¶
type LSPSelector struct {
LanguageID string
LanguageIDProvenance Provenance
Pattern string
PatternProvenance Provenance
Provenance Provenance
}
LSPSelector routes files matching Pattern to an LSP using LanguageID for text-document synchronization. Pattern is workspace-relative and uses doublestar path syntax.
type LSPSource ¶
type LSPSource struct {
Name string
Scope *Scope
ScopeProvenance Provenance
ImplementationID *string
ImplementationIDProvenance Provenance
Selectors []LSPSelector
Stdio *StdioSource
Provenance
}
LSPSource is a potentially partial language-server layer.
type OAuth ¶
type OAuth struct {
ClientID string
ClientIDProvenance Provenance
ClientSecret *Value
RedirectURI string
RedirectURIProvenance Provenance
Provenance
}
OAuth describes a complete preregistered OAuth client for an HTTP server. When OAuth is nil, execution may use dynamic client registration instead.
type OAuthSource ¶
type OAuthSource struct {
ClientID *string
ClientIDProvenance Provenance
ClientSecret *Value
RedirectURI *string
RedirectURIProvenance Provenance
Provenance
}
OAuthSource is a potentially partial preregistered OAuth client layer. ClientSecret is optional even in a complete OAuth configuration.
type Provenance ¶
Provenance identifies the configuration source and semantic location that supplied a model value.
type ResolvedValue ¶
ResolvedValue is a value ready for a destination. Sensitive marks values that must be kept out of normal diagnostics.
type Root ¶
type Root struct {
Path string
Provenance
}
Root is a configured workspace root. Resolving relative paths and applying caller overrides are daemon concerns, not configuration composition.
type Scope ¶
type Scope string
Scope identifies the context that owns a configured server instance.
const ( // ScopeWorkspace makes a server instance specific to its effective workspace. ScopeWorkspace Scope = "workspace" )
type Secrets ¶ added in v0.4.0
type Secrets struct {
Age *AgeSecrets
}
Secrets is the complete secret-provider configuration consumed by secret resolution. Nil providers are not configured.
type SecretsSource ¶ added in v0.4.0
type SecretsSource struct {
Age *AgeSecretsSource
Provenance Provenance
}
SecretsSource is a potentially partial secret-provider configuration layer.
type Server ¶
type Server struct {
Name string
Scope Scope
ScopeProvenance Provenance
Stdio Stdio
HTTP *HTTP
Provenance
}
Server is a named complete configured capability source.
type ServerSource ¶
type ServerSource struct {
Name string
Scope *Scope
ScopeProvenance Provenance
Stdio *StdioSource
HTTP *HTTPSource
Provenance
}
ServerSource is a potentially partial server layer.
type Source ¶
type Source struct {
Root *Root
Secrets *SecretsSource
Servers []ServerSource
LSPs []LSPSource
Provenance
}
Source is one partially specified KDL configuration layer. It is valid for a source to omit fields that are supplied by a weaker layer.
func ParseString ¶
ParseString is Parse for source text already held in memory.
type Stdio ¶
type Stdio struct {
Command string
CommandProvenance Provenance
Args []Value
Env []Environment
Provenance
}
Stdio describes one complete local command transport.
type StdioSource ¶
type StdioSource struct {
Command *string
CommandProvenance Provenance
Args []Value
Env []Environment
Provenance
}
StdioSource is a potentially partial stdio layer. A non-empty Args slice replaces inherited arguments; Env entries merge by name.
type Value ¶
type Value struct {
Kind ValueKind
Text string
Provenance
}
Value is a textual literal or an annotated secret reference. Text is the literal text for ValueLiteral and the unresolved reference for ValueSecretReference.