statuspatchprojection

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InputPatch

type InputPatch struct {
	Namespace       string
	Name            string
	APIVersion      string
	Kind            string
	UID             string
	ResourceVersion string
	ListOwnership   string
	Variants        map[string]map[string]any
	SourceTemplate  string
	SourceLine      int
}

InputPatch is detached by New before it becomes cached state.

type Metadata

type Metadata struct {
	Namespace       string
	Name            string
	APIVersion      string
	Kind            string
	UID             string
	ResourceVersion string
	ListOwnership   string
	SourceTemplate  string
	SourceLine      int
}

Metadata is a detached immutable patch descriptor.

type Part

type Part struct {
	Root  *Root
	Owner any
}

Part authenticates one child root while constructing a composite root.

type PatchView

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

PatchView is an authenticated read-only reference into a Root.

func (PatchView) Metadata

func (v PatchView) Metadata() (Metadata, error)

Metadata returns detached scalar metadata for the referenced patch.

func (PatchView) Owner

func (v PatchView) Owner() (any, error)

Owner returns the exact owner token bound to the referenced leaf root.

func (PatchView) Same

func (v PatchView) Same(other PatchView) bool

Same reports exact authenticated patch identity: the same patch of the same root under the same owner, which makes every phase the same too.

func (PatchView) VisitPhases

func (v PatchView) VisitPhases(visitor func(PhaseView) error) error

VisitPhases walks the referenced patch's phases in sorted order.

type PhaseView

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

PhaseView is an authenticated read-only reference into a Root.

func (PhaseView) BelongsTo

func (v PhaseView) BelongsTo(patchView PatchView) bool

BelongsTo reports whether the phase belongs to patchView.

func (PhaseView) Materialize

func (v PhaseView) Materialize() (map[string]any, error)

Materialize returns a detached status object.

func (PhaseView) Name

func (v PhaseView) Name() (string, error)

Name returns the referenced phase name.

func (PhaseView) Same

func (v PhaseView) Same(other PhaseView) bool

Same reports exact authenticated phase identity.

type PlanEntry

type PlanEntry struct {
	Group string
	Entry string
	Root  *Root
	Owner any
}

PlanEntry identifies one exact projection root at an ordered plan location.

type PlanGroup

type PlanGroup struct {
	Name  string
	Root  *Root
	Owner any
}

PlanGroup identifies one exact projection root in a plan.

type PlanPatch

type PlanPatch struct {
	Group    PlanGroup
	View     PatchView
	EntryKey string
	Position int
}

PlanPatch locates an immutable patch in the plan's full replay order.

type PlanRoot

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

PlanRoot is an immutable exact group, phase-owner, and lineage index.

func NewPlan

func NewPlan(owner any) (*PlanRoot, error)

NewPlan returns an empty plan bound to owner.

func NewPlanFromEntries

func NewPlanFromEntries(owner any, entries []PlanEntry) (*PlanRoot, error)

NewPlanFromEntries returns a plan built atomically from exact ordered entries.

func (*PlanRoot) ContainsTarget

func (p *PlanRoot) ContainsTarget(owner any, namespace, name, apiVersion, kind string) (bool, error)

ContainsTarget reports whether a target identity is present in the plan.

func (*PlanRoot) ExactEntry

func (p *PlanRoot) ExactEntry(
	owner any,
	group, entry string,
	root *Root,
	rootOwner any,
) (bool, error)

ExactEntry reports whether an ordered group entry already points at root with the exact owner.

func (*PlanRoot) ExactGroup

func (p *PlanRoot) ExactGroup(owner any, group string, root *Root, rootOwner any) (bool, error)

ExactGroup reports whether group already points at root with the exact owner.

func (*PlanRoot) Groups

func (p *PlanRoot) Groups(owner any) ([]PlanGroup, error)

Groups returns the exact group roots in lexical group order.

func (*PlanRoot) Replace

func (p *PlanRoot) Replace(
	owner, nextOwner any,
	group string,
	root *Root,
	rootOwner any,
) (*PlanRoot, error)

Replace returns a fresh plan root after atomically replacing one group.

func (*PlanRoot) ReplaceEntry

func (p *PlanRoot) ReplaceEntry(
	owner, nextOwner any,
	group, entry string,
	root *Root,
	rootOwner any,
) (*PlanRoot, error)

ReplaceEntry returns a fresh plan root after atomically replacing one ordered group entry.

func (*PlanRoot) TargetCount

func (p *PlanRoot) TargetCount(owner any) (int, error)

TargetCount returns the number of unique target resources.

func (*PlanRoot) Validate

func (p *PlanRoot) Validate(owner any) error

Validate verifies exact plan ownership and persistent-root identity.

func (*PlanRoot) ValidateLineage

func (p *PlanRoot) ValidateLineage(
	owner any,
	namespace, name, apiVersion, kind, uid, resourceVersion string,
	listOwnership ...string,
) error

ValidateLineage verifies that a direct patch can be overlaid by the plan.

func (*PlanRoot) VisitChangedTargets

func (p *PlanRoot) VisitChangedTargets(owner any, previous *PlanRoot, previousOwner any, visit func(Metadata) error) error

VisitChangedTargets reports changed contributions, including removed targets.

func (*PlanRoot) VisitGroups

func (p *PlanRoot) VisitGroups(owner any, visit func(PlanGroup) error) error

VisitGroups visits exact group roots in lexical group order.

func (*PlanRoot) VisitTargetPatches

func (p *PlanRoot) VisitTargetPatches(owner any, target *Metadata, visit func(PlanPatch) error) error

VisitTargetPatches visits every current contribution to one target, in replay order.

type Root

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

Root owns a projection payload that callers cannot mutate through safe Go.

func New

func New(owner any, calls []InputPatch) (*Root, error)

New detaches patches into an opaque root bound to owner.

func NewGroup

func NewGroup(owner any, parts []Part) (*Root, error)

NewGroup composes authenticated roots without exposing or copying payloads.

func (*Root) PatchCount

func (r *Root) PatchCount(owner any) (int, error)

PatchCount returns the number of projected patch records.

func (*Root) Validate

func (r *Root) Validate(owner any) error

Validate verifies exact root ownership in constant time.

func (*Root) Visit

func (r *Root) Visit(owner any, visitor func(PatchView) error) error

Visit walks every leaf patch in deterministic part and patch order.

Jump to

Keyboard shortcuts

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