Documentation
¶
Overview ¶
Package configgen implements the development-time generator behind cmd/kms-config-gen.
Index ¶
Constants ¶
const DefaultsFuncName = "Defaults"
DefaultsFuncName is the defaults function the generator looks for when none is named explicitly.
Variables ¶
var ErrStale = errors.New("generated configuration artifacts are stale")
ErrStale marks verification failures caused by missing or out-of-date files.
Functions ¶
func Verify ¶
func Verify(paths OutputPaths, artifacts Artifacts) error
Verify compares generated artifacts without changing the filesystem.
func Write ¶
func Write(paths OutputPaths, artifacts Artifacts) error
Write writes all artifacts atomically. Existing files whose content already matches are left untouched.
Types ¶
type Artifacts ¶
Artifacts contains the three complete, newline-terminated generated files. Binding has already been gofmt formatted.
type Options ¶
type Options struct {
Package string
Dir string
Type string
BindingPackage string
Env []string
// DefaultsFunc names the package-level function whose returned literal
// supplies schema defaults. Empty looks for Defaults when present; "-"
// disables the lookup; any other name is required to exist.
DefaultsFunc string
}
Options describes one generator invocation. Package defaults to the current package ("."). Dir controls the working directory used by go/packages.
type OutputPaths ¶
OutputPaths identifies the application-controlled artifact destinations.
type StaleError ¶
type StaleError struct{ Paths []string }
StaleError lists every stale artifact rather than failing at the first file.
func (*StaleError) Error ¶
func (e *StaleError) Error() string
func (*StaleError) Unwrap ¶
func (e *StaleError) Unwrap() error