configplane

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Token         = "plane-token-1"
	ClientID      = "agent-client"
	ClientSecret  = "agent-secret"
	Instance      = "inst-0001"
	MaxValueDepth = 32
)

Variables

This section is empty.

Functions

func DeepMerge

func DeepMerge(base, over map[string]any) map[string]any

Merges over into base, lists replace, null over a mapping is ignored and null over anything else sets null

Types

type Lock

type Lock struct {
	Path  []string
	Level string
}

Lock path and the level that holds it

type Plane

type Plane struct {
	Mu              sync.Mutex
	Upper           map[string]any
	UpperLocks      []map[string]any
	Groups          []map[string]any
	GroupProvenance map[string]any
	Profiles        map[string]*Profile
	FailStatus      int
	EtagOverride    string
	Requests        []Request
	TokenRequests   int
	Home            string
	URL             string
	OnGet           func()
	RefusePatch     *Refusal
	// contains filtered or unexported fields
}

Contract faithful config plane double with one upper document, per profile values and an IdP token endpoint

func New

func New(t testing.TB, rules Rules) *Plane

Starts the plane on loopback and closes it when the test ends

func (*Plane) Effective

func (p *Plane) Effective(name string) map[string]any

Effective response for a profile, the etag a digest of the body

func (*Plane) Gets

func (p *Plane) Gets() []Request

GET requests received so far

func (*Plane) Patches

func (p *Plane) Patches() []Request

PATCH requests received so far

func (*Plane) Profile

func (p *Plane) Profile(name string) *Profile

Profile record by name, created empty at version zero on first use

type Profile

type Profile struct {
	Values  map[string]any
	Version int
}

Profile layer the plane stores with its version

type Refusal

type Refusal struct {
	Status int
	Body   map[string]any
}

Status and body the plane answers every PATCH with instead of applying it

type Request

type Request struct {
	Method, Profile, Auth, Instance, IfNoneMatch string
	Body                                         map[string]any
}

One request the plane received on its config route

type Rules

type Rules struct {
	Decode        func(encoded string) ([]string, error)
	Encode        func(segments []string) string
	WriteCheck    func(setPaths [][]string, setValues []any, unsets [][]string, locks []Lock) (Lock, bool)
	SecretLiteral func(path []string, value any) bool
}

Agent side helpers a write is checked against, the same ones the remote backend uses

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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