Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsRef ¶
ContainsRef reports whether s contains a ${...} reference.
Types ¶
type Resolver ¶
type Resolver struct {
Getenv func(string) string
Pass func(path string) (string, error)
// contains filtered or unexported fields
}
Resolver replaces ${...} references with values from pass or the environment. Resolved tokens are memoized for the Resolver's lifetime (one `pass` invocation per distinct token per run; the CLI is single-threaded, so a plain map suffices).
func NewResolver ¶
func NewResolver() *Resolver
NewResolver returns a Resolver backed by os.Getenv and `pass show`.
func (*Resolver) ResolveJSON ¶
ResolveJSON parses a JSON-encoded value and resolves ${...} tokens in every string leaf, returning the resolved Go value. Resolving on parsed leaves (not on the serialized text) means a secret containing quotes, backslashes, or newlines can never corrupt the document or inject sibling keys.