parameters

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package parameters implements bounded, single-pass config substitution. Parameters are public configuration, never secret inputs or expressions.

Index

Constants

View Source
const (
	// MaxContractBytes bounds immutable schema metadata per publication.
	MaxContractBytes = 256 << 10
	MaxCount         = 32
	MaxValueBytes    = 256
	MaxPatternBytes  = 512
)

Variables

This section is empty.

Functions

func CheckDeclaration

func CheckDeclaration(name, pattern string) error

func CheckName

func CheckName(name string) error

func CheckReferences

func CheckReferences(value string, declarations map[string]string) error

func CheckSupplied

func CheckSupplied(values map[string]string) error

func Encode

func Encode(values map[string]string) string

func References

func References(value string) ([]string, error)

References accepts ${NAME}; $${ escapes a literal ${ without a closing brace.

func Resolve

func Resolve(value string, supplied map[string]string, maxBytes int) (string, error)

Resolve substitutes once. Caller inputs are never scanned as new expressions.

func Validate

func Validate(declarations, supplied map[string]string) error

Types

type Contract

type Contract struct {
	Version      int               `json:"version,omitempty"`
	Declarations map[string]string `json:"declarations,omitempty"`
	Schemas      map[string]string `json:"schemas,omitempty"`
}

Contract is immutable snapshot metadata. Schemas records the declarations of templated config keys, so historical delivery never consults the live schema.

Jump to

Keyboard shortcuts

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