datamodel

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

package datamodel - for modeling and managing that model

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcDatamodelStepwiseDiff

func CalcDatamodelStepwiseDiff(dm *Datamodel) error

func FindHistoryBaseDir

func FindHistoryBaseDir() (string, error)

func RunCheckpointFromArgs

func RunCheckpointFromArgs(args []string, bump string, flgs flags.DatamodelPflagpole) error

func RunDiffFromArgs

func RunDiffFromArgs(args []string, flgs flags.DatamodelPflagpole) error

func RunHistoryFromArgs

func RunHistoryFromArgs(args []string, flgs flags.DatamodelPflagpole) error

func RunInfoFromArgs

func RunInfoFromArgs(args []string, flgs flags.DatamodelPflagpole) error

func RunListFromArgs

func RunListFromArgs(args []string, flgs flags.DatamodelPflagpole) error

func RunLogFromArgs

func RunLogFromArgs(args []string, flgs flags.DatamodelPflagpole) error

Types

type Common

type Common struct {
	// User set
	Name   string
	Labels map[string]string

	// internally set
	Status    string // should probably be an const [ok,dirty,no history]
	Label     string // label from CUE
	Timestamp string // timestamp
	Version   string // @dm_ver()

	Value   cue.Value // this objects value
	Other   cue.Value // the other value for diff
	Diff    cue.Value // diff from other (checkpoint)
	Subsume error
}

type Datamodel

type Datamodel struct {
	Models map[string]*Model

	// filled fields
	OrderedModels []*Model
	History       *History

	Common
}

func LoadDatamodels

func LoadDatamodels(entrypoints []string, flgs flags.DatamodelPflagpole) (dms []*Datamodel, err error)

func PrepDatamodels

func PrepDatamodels(entrypoints []string, flgs flags.DatamodelPflagpole) (dms []*Datamodel, err error)

type Field

type Field struct {
	Type string

	Common
}

type History

type History struct {
	Curr *Datamodel   // Top-level Datamodel, there should only be one history
	Prev *Datamodel   // The previous datamodel, when needed for comparison
	Past []*Datamodel // the full history of the datamodel
}

type Model

type Model struct {
	Fields map[string]*Field

	// Filled fields
	OrderedFields []*Field
	Path          []string

	Common
}

Jump to

Keyboard shortcuts

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