render

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package render resolves dotenv "ref+..." references into secret values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(r io.Reader, w io.Writer, res Resolver, style dotenv.QuoteStyle) error

Render scans a dotenv stream from r, resolves every full-value ref+/secretref+ reference through res in a single batch, splices the resolved values back into their exact source lines, and writes the byte-faithful result to w.

It is fail-closed: any failure (multiline reject, resolver error, emit failure, or residual-reference scan) returns an error and writes NOTHING to w. Nothing is ever written to w until the full output is buffered and every guard has passed. Per-backend credentials are the resolver's concern: vals surfaces its own auth errors uniformly, which Render propagates unchanged.

style selects how resolved values are quoted: dotenv.QuoteMinimal preserves the default byte-faithful output, dotenv.QuoteShell emits source-safe output.

Types

type Resolver

type Resolver interface {
	Resolve(refs map[string]string) (map[string]string, error)
}

Resolver resolves a set of ref+ references to their secret values. Keyed by the dotenv KEY; each value is a full "ref+..." expression.

type ValsResolver

type ValsResolver struct {
	// contains filtered or unexported fields
}

ValsResolver resolves references through the helmfile/vals runtime.

func NewValsResolver

func NewValsResolver() (*ValsResolver, error)

NewValsResolver constructs a fail-closed vals runtime. FailOnMissingKeyInMap ensures a missing fragment key (e.g. ref+doppler://p/c#/KEY) errors instead of silently resolving to nil.

func (*ValsResolver) Resolve

func (r *ValsResolver) Resolve(refs map[string]string) (map[string]string, error)

Resolve evaluates every ref in one batch Eval and returns KEY->value. Any Eval error is returned unchanged (fail-closed; caller aborts).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL