state

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const SchemaVersion = "1.0"

SchemaVersion is the current schema version.

View Source
const SchemaVersionID = uint16(1)

SchemaVersionID is the numeric schema version stored in session blobs.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compatibility

type Compatibility int

Compatibility indicates schema compatibility.

const (
	CompatibilitySame Compatibility = iota
	CompatibilityAdditive
	CompatibilityIncompatible
)

func CompareSchemas

func CompareSchemas(persisted, current *Schema) (Compatibility, []string)

CompareSchemas compares persisted vs current schema and returns compatibility and reasons.

type InspectEntry

type InspectEntry struct {
	StableID  string `json:"stableID"`
	DebugName string `json:"debugName,omitempty"`
	AnchorKey string `json:"anchorKey"`
	Kind      string `json:"kind"`
	Class     string `json:"class"`
	Persisted bool   `json:"persisted"`
}

InspectEntry is one item from `vango inspect state --json`.

func ParseInspectJSON

func ParseInspectJSON(data []byte) ([]InspectEntry, error)

ParseInspectJSON parses `vango inspect state --json` output.

type InspectIndex

type InspectIndex struct {
	ByAnchorKey map[string]InspectEntry
	ByStableID  map[string][]InspectEntry
	ByDebugName map[string][]InspectEntry
}

InspectIndex provides deterministic identity lookups for tests/debug/devtools.

func BuildInspectIndex

func BuildInspectIndex(entries []InspectEntry) InspectIndex

BuildInspectIndex builds deterministic lookup maps from inspect entries.

type PersistedPrimitive

type PersistedPrimitive struct {
	StableID         string `json:"stableID"`
	Scope            string `json:"scope"`
	Kind             string `json:"kind"`
	CodecFingerprint string `json:"codecFingerprint"`
}

PersistedPrimitive represents a persisted primitive in the schema.

type Schema

type Schema struct {
	SchemaVersion       string               `json:"schemaVersion"`
	PersistedPrimitives []PersistedPrimitive `json:"persistedPrimitives"`
	SessionKeys         []SessionKeySchema   `json:"sessionKeys"`
	SchemaHash          string               `json:"schemaHash"`
}

Schema represents the runtime state schema for persisted primitives.

func BuildCurrentSchema

func BuildCurrentSchema() *Schema

BuildCurrentSchema builds the schema from runtime bindings.

func (*Schema) Hash

func (s *Schema) Hash() string

Hash returns the schema hash, computing it if needed.

type SessionKeySchema

type SessionKeySchema struct {
	Name             string `json:"name"`
	StableID         string `json:"stableID"`
	CodecFingerprint string `json:"codecFingerprint"`
	HasDefault       bool   `json:"hasDefault"`
}

SessionKeySchema represents a typed session key in the schema.

Jump to

Keyboard shortcuts

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