Documentation
¶
Overview ¶
Package discovery resolves trusted Wirecmd configuration sources.
Index ¶
- func List() ([]string, error)
- func Paths(cwd string) ([]string, error)
- func SecretStoreCandidates(cwd string, configPaths []string, automatic bool) ([]string, error)
- func Status(path string) (string, bool, string, error)
- func Trust(path string) (string, error)
- func Untrust(path string) (string, error)
- type NotFoundError
- type Result
- type UntrustedError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SecretStoreCandidates ¶ added in v0.4.0
SecretStoreCandidates returns encrypted age-store paths in strongest to weakest precedence order. Candidates are returned whether or not they exist so callers can detect store appearance and removal without discovery hiding those transitions.
Automatic discovery walks from cwd through the nearest trusted root. Explicit configuration uses only siblings of the supplied paths in reverse source precedence and never consults trusted-workspace state.
func Status ¶
Status returns the canonical path, whether it is covered, and the nearest trusted root.
Types ¶
type NotFoundError ¶
type NotFoundError struct{}
NotFoundError reports that neither global nor workspace configuration exists.
func (*NotFoundError) Error ¶
func (*NotFoundError) Error() string
type Result ¶ added in v0.5.0
type Result struct {
CWD string
Paths []string
TrustedRoot string
WorkspaceConfig string
WorkspaceDirectory string
}
Result is the trusted automatic-discovery state for one invocation. Paths are ordered from weakest to strongest. WorkspaceConfig and WorkspaceDirectory describe the nearest discovered workspace configuration within TrustedRoot; they are empty when automatic discovery is global-only.
type UntrustedError ¶
type UntrustedError struct{ Workspace string }
UntrustedError reports the nearest workspace configuration that requires trust.
func (*UntrustedError) Error ¶
func (e *UntrustedError) Error() string