Documentation ¶
Overview ¶
This package manages the #hof: _ configuration and the various @<hof>() attributes
Index ¶
- func Walk(v cue.Value, before func(cue.Value) bool, after func(cue.Value), ...)
- func WalkOrig(v cue.Value, before func(cue.Value) bool, after func(cue.Value), ...)
- type Chat
- type Datamodel
- type Flow
- type Gen
- type Hof
- type Metadata
- type Node
- func FindHofs(value cue.Value) (roots []*Node[any], err error)
- func FindHofsOrig(value cue.Value) (roots []*Node[any], err error)
- func New[T any](label string, val cue.Value, curr *T, parent *Node[T]) *Node[T]
- func ParseHof[T any](val cue.Value) (*Node[T], error)
- func Upgrade[S, T any](src *Node[S], upgrade func(*Node[T]) *T, parent *Node[T]) *Node[T]
- type Pool
- type Print
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Walk ¶
Walk is an alternative to cue.Value.Walk which handles more field types You can customize this with your own options returning false will stop recursion for that node
func WalkOrig ¶ added in v0.6.9
func WalkOrig(v cue.Value, before func(cue.Value) bool, after func(cue.Value), options ...cue.Option)
Walk is an alternative to cue.Value.Walk which handles more field types You can customize this with your own options returning false will stop recursion for that node
Types ¶
type Datamodel ¶
type Datamodel struct { // Root for datamodel features // This acts as the entrypoint // the other fields determine behavior Root bool // index, pivot, level, hierachy, node? Node bool // Enable snapshots and history in .hof/dm/... History bool // create an Ordered<Label> list in parent data // where elements are from CUE iteration of fields Ordered bool // treat as a cue value // nesting stops here and the whole // value is tracked as a singular value // support incomplete values & schemas Cue bool // Semantic version for value Version string }
hof/datamodel configuration
type Flow ¶
hof/flow configuration this has more shorthands @flow() | @flow(name) @task(op) | @task(op,name)
type Hof ¶
type Hof struct { // label from containing value in CUE Label string // path to containing value in CUE Path string // Semantic hof datamodel api-version for compat APIVersion string // #hof: metadata: ... Metadata Metadata // #hof: <feature>: ... // @<feature>(<name>) can be shorthand with no-name implying label? Datamodel Datamodel Gen Gen Flow Flow Chat Chat // any extra config, set by users Extra map[string]any }
#hof: ...
type Metadata ¶
type Metadata struct { // A unique ID as @id(string) generated by hof ID string `json:"id"` // Given name for the value Name string // arbitrary key=string data Labels map[string]string // CUE import path / package // only needs to be set if importing elsewhere Package string }
Common Metadata
type Node ¶
type Node[T any] struct { Hof Hof // do not modify, root value containing Value cue.Value // The wrapping type T *T // heirarchy of tracked values Parent *Node[T] // we (this node) are in between Children []*Node[T] }
func FindHofsOrig ¶ added in v0.6.9
func (*Node[T]) PrintDatamodel ¶ added in v0.6.9
Click to show internal directories.
Click to hide internal directories.