base

package
v0.0.0-...-e73b65a Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxDetail = libmodel.MaxDetail
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BranchNavigator

type BranchNavigator interface {
	Next(Model) ([]Model, error)
}

Tree navigator. Navigate down the children.

type Concern

type Concern struct {
	Label      string `json:"label"`
	Category   string `json:"category"`
	Assessment string `json:"assessment"`
}

VM concerns.

type InvalidKindError

type InvalidKindError struct {
	Object interface{}
}

Invalid kind.

func (InvalidKindError) Error

func (r InvalidKindError) Error() string

type InvalidRefError

type InvalidRefError struct {
	Ref
}

Invalid reference.

func (InvalidRefError) Error

func (r InvalidRefError) Error() string

type ListOptions

type ListOptions = libmodel.ListOptions

type Model

type Model = libmodel.Model

type ParentNavigator

type ParentNavigator interface {
	Next(Model) (Model, error)
}

Tree navigator. Navigate up the parent tree.

type Ref

type Ref struct {
	// The kind (type) of the referenced.
	Kind string `json:"kind"`
	// The ID of object referenced.
	ID string `json:"id"`
}

An object reference.

type Tree

type Tree struct {
	// Depth limit (0=unlimited).
	Depth int
}

Tree.

func (*Tree) Ancestry

func (r *Tree) Ancestry(leaf Model, navigator ParentNavigator) (treeRoot *TreeNode, err error)

Build the (ancestry) tree.

func (*Tree) Build

func (r *Tree) Build(root Model, navigator BranchNavigator) (treeRoot *TreeNode, err error)

Build the tree.

type TreeNode

type TreeNode struct {
	// Parent node.
	Parent *TreeNode
	// Kind of model.
	Kind string
	// Model.
	Model Model
	// Child nodes.
	Children []*TreeNode
}

Tree node.

Jump to

Keyboard shortcuts

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