Documentation ¶
Index ¶
- Constants
- func DatamodelType(DM *Datamodel) string
- func DiffValue(orig, next cue.Value) (cue.Value, error)
- func HistoryBaseDir() (string, error)
- type Datamodel
- func (dm *Datamodel) CalcDiffs() error
- func (dm *Datamodel) EnrichValue() error
- func (dm *Datamodel) FindMaxLabelLen(dflags flags.DatamodelPflagpole) int
- func (dm *Datamodel) GetSnapshotList() map[string][]*Snapshot
- func (dm *Datamodel) HasDiff() bool
- func (dm *Datamodel) HasHistory() (bool, error)
- func (dm *Datamodel) LoadHistory() error
- func (dm *Datamodel) MakeSnapshot(timestamp string, dflags flags.DatamodelPflagpole, ...) error
- func (dm *Datamodel) PrintDiff(out io.Writer, dflags flags.DatamodelPflagpole) error
- func (dm *Datamodel) PrintLog(out io.Writer, max int, ts string, dflags flags.DatamodelPflagpole, ...) error
- func (dm *Datamodel) PrintLogByValue(out io.Writer, max int, dflags flags.DatamodelPflagpole, ...) error
- func (dm *Datamodel) PrintTree(out io.Writer, max int, dflags flags.DatamodelPflagpole) error
- func (dm *Datamodel) Status() string
- type Lense
- type Snapshot
- type Value
Constants ¶
const CheckpointTimeFmt = "20060102150405"
YYYYMMDDHHMMSS in Golang
Variables ¶
This section is empty.
Functions ¶
func DatamodelType ¶ added in v0.6.8
func HistoryBaseDir ¶ added in v0.6.8
Types ¶
type Datamodel ¶ added in v0.6.1
this is basically the same as a Value except that it reporesents a conceptual root and we want specific functions on it that are different from general Nodes' handling and recursion type Datamodel *hof.Node[Value]
func (*Datamodel) EnrichValue ¶ added in v0.6.8
func (*Datamodel) FindMaxLabelLen ¶ added in v0.6.8
func (dm *Datamodel) FindMaxLabelLen(dflags flags.DatamodelPflagpole) int
func (*Datamodel) GetSnapshotList ¶ added in v0.6.8
GetSnapshotList finds all snapshots from top-level @history() values. It returns a map where the key is the path to the @history and the value is a list of all snapshots at that value. The top most parent will contain all snapshots for any nested values, due to the way diffs propagate up the hof node tree You should not modify the returned snapshots
func (*Datamodel) HasHistory ¶ added in v0.6.8
check for any history
func (*Datamodel) LoadHistory ¶ added in v0.6.8
LoadHistory loads the full datamodel history
func (*Datamodel) MakeSnapshot ¶ added in v0.6.8
func (dm *Datamodel) MakeSnapshot(timestamp string, dflags flags.DatamodelPflagpole, cflags flags.Datamodel__CheckpointFlagpole) error
MakeSnapshot creates a new snapshot for each history annotation in the Datamodel tree
func (*Datamodel) PrintLog ¶ added in v0.6.8
func (dm *Datamodel) PrintLog(out io.Writer, max int, ts string, dflags flags.DatamodelPflagpole, cflags flags.Datamodel__LogFlagpole) error
func (*Datamodel) PrintLogByValue ¶ added in v0.6.8
func (dm *Datamodel) PrintLogByValue(out io.Writer, max int, dflags flags.DatamodelPflagpole, cflags flags.Datamodel__LogFlagpole) error
type Lense ¶ added in v0.6.8
type Lense struct { // Explination for the snapshot or changes therein Description string CurrVersion string PrevVersion string // calculated by hof CurrDiff cue.Value // prev -> this PrevDiff cue.Value // this -> prev // user defined transform to cover the gaps // make use of structural to support @st(...) CurrUser cue.Value // prev -> this PrevUser cue.Value // this -> prev // the full transformation or migration to implement the lens // calculated as NextDiff & NextUser => NextMig CurrMig cue.Value // prev -> this PrevMig cue.Value // this -> prev }
type Snapshot ¶ added in v0.6.8
type Snapshot struct { // The current value at this snapshot Value cue.Value Data any // Position in history Pos int // Point it was snapshotted Timestamp string // crypto hash of (snapshot data?) Hash string // Explination for the snapshot or changes therein Message string // Lenses between neighboring snapshots Lense Lense }
Snapshot represents a Value at a point in time
type Value ¶ added in v0.6.8
type Value struct { *hof.Node[Value] // curr & lineage Snapshot *Snapshot // contains filtered or unexported fields }
func (*Value) HasHistory ¶ added in v0.6.8
check for any history