overrides

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(overrides []Override) (string, error)

Hash computes a stable hash of overrides for cache keying. Returns empty string and nil error if no overrides.

func SetStore

func SetStore(ctx context.Context, store *Store) context.Context

SetStore adds an override Store to the context.

Types

type AppliedOverride

type AppliedOverride struct {
	Path   string `json:"path"`
	Reason string `json:"reason"`
}

AppliedOverride records what was actually changed during execution.

type FieldInfo

type FieldInfo struct {
	Path        string `json:"path"`
	Type        string `json:"type"`
	Description string `json:"description"`
	NodeType    string `json:"node_type,omitempty"`
}

FieldInfo describes a single overridable field for catalog/discovery.

type Override

type Override struct {
	Path   string `json:"path"`   // e.g., "source_url"
	Value  any    `json:"value"`  // replacement value
	Reason string `json:"reason"` // E&O audit trail
}

Override represents a single field override request.

type Store

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

Store holds overrides and tracks which were applied during execution.

func GetStore

func GetStore(ctx context.Context) *Store

GetStore retrieves the override Store from the context. Returns nil if no store was set.

func NewStore

func NewStore(overrides []Override) *Store

NewStore creates a new Store from a list of overrides.

func (*Store) GetAll

func (s *Store) GetAll() []Override

GetAll returns all overrides in the store (original order).

func (*Store) GetApplied

func (s *Store) GetApplied() []AppliedOverride

GetApplied returns all overrides that were applied during execution.

func (*Store) RecordApplied

func (s *Store) RecordApplied(applied AppliedOverride)

RecordApplied records an override that was successfully applied.

func (*Store) WarnUnconsumed

func (s *Store) WarnUnconsumed(ctx context.Context)

WarnUnconsumed logs a warning for any overrides that were not applied by any node.

Jump to

Keyboard shortcuts

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