Versions in this module Expand all Collapse all v0 v0.2.0 Jul 14, 2026 v0.1.0 Jul 13, 2026 Changes in this version + const ScopeBaseline + const ScopeEnvironmentOverride + var ErrEnvironmentNotFound = errors.New("draft environment not found") + var ErrInvalidScope = errors.New("invalid draft write scope") + var ErrSourceRevisionChanged = errors.New("source revision changed") + func EnsureSchema(schema Schema) error + func FormatRevision(revision uint64) string + func ParseRevision(etag string) (uint64, error) + func ValidScope(scope string) bool + type ConfigurationPresence struct + Present bool + Value map[string]any + func (p ConfigurationPresence) MarshalJSON() ([]byte, error) + type ConflictError struct + Code string + ConflictScope string + CurrentRevision uint64 + CurrentSourceRevision string + CurrentState View + func (e *ConflictError) Error() string + type Environment struct + ID string + Kind string + Name string + type Field struct + Default any + Enum []any + EnvironmentOverrideAllowed bool + MaxLength *int + Maximum *float64 + MinLength *int + Minimum *float64 + Nullable bool + Path string + Required bool + Type string + type FieldState struct + Baseline FieldValuePresence + DraftBaseline FieldValuePresence + DraftEnvironmentOverride FieldValuePresence + Effective FieldValuePresence + EnvironmentOverride FieldValuePresence + EnvironmentOverrideAllowed bool + IsEnvironmentOverridden bool + Nullable bool + Origin string + PackDefault FieldValuePresence + Path string + SourceRevision string + type FieldValuePresence struct + Present bool + Value any + func (p FieldValuePresence) MarshalJSON() ([]byte, error) + type LayerState struct + Dirty bool + Draft ConfigurationPresence + Resolved ConfigurationPresence + Source ConfigurationPresence + type Mutation struct + Action string + Configuration json.RawMessage + ExpectedRevision uint64 + ExpectedSourceRevision string + Prepare func(View) (json.RawMessage, error) + Scope string + Validate func(map[string]any) error + type Save struct + Commit func(SourceSnapshot, State) (SourceSnapshot, error) + ExpectedRevision uint64 + ExpectedSourceRevision string + type Schema struct + Defaults map[string]any + Fields []Field + PackRef string + type SourceProvider func() (SourceSnapshot, error) + type SourceSnapshot struct + Baseline map[string]any + EnvironmentOverrides map[string]map[string]any + Revision string + type State struct + Baseline map[string]any + BaselinePresent bool + EnvironmentOverrides map[string]map[string]any + Revision uint64 + type Store struct + func NewMemory(source SourceSnapshot, state State) *Store + func Open(path string, source SourceProvider) (*Store, error) + func (s *Store) Mutate(schema Schema, environments []Environment, environmentID string, ...) (View, uint64, error) + func (s *Store) SaveToSource(schema Schema, environments []Environment, environmentID string, save Save) (View, uint64, error) + func (s *Store) View(schema Schema, environments []Environment, environmentID string) (View, uint64, error) + type StructuralError struct + Code string + Message string + Path string + Scope string + func ValidateReplacement(schema Schema, scope string, raw json.RawMessage) (map[string]any, []StructuralError) + type ValidationError struct + Details []StructuralError + func (e *ValidationError) Error() string + type View struct + AffectedEnvironments []Environment + Baseline LayerState + Dirty bool + DirtyScopes []string + Effective map[string]any + EnvironmentID string + EnvironmentOverride LayerState + FieldStates []FieldState + PackRef string + SourceRevision string + func BuildView(schema Schema, environments []Environment, source SourceSnapshot, state State, ...) (View, error)