d2oracle

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MPL-2.0 Imports: 15 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(g *d2graph.Graph, boardPath []string, key string) (_ *d2graph.Graph, newKey string, err error)

func Delete

func Delete(g *d2graph.Graph, boardPath []string, key string) (_ *d2graph.Graph, err error)

func DeleteIDDeltas

func DeleteIDDeltas(g *d2graph.Graph, boardPath []string, key string) (deltas map[string]string, err error)

func GetBoardGraph added in v0.6.0

func GetBoardGraph(g *d2graph.Graph, boardPath []string) *d2graph.Graph

func GetChildrenIDs added in v0.5.0

func GetChildrenIDs(g *d2graph.Graph, boardPath []string, absID string) (ids []string, _ error)

func GetEdge

func GetEdge(g *d2graph.Graph, boardPath []string, absID string) *d2graph.Edge

func GetID added in v0.5.0

func GetID(key string) string

func GetObj

func GetObj(g *d2graph.Graph, boardPath []string, absID string) *d2graph.Object

func GetObjOrder added in v0.5.0

func GetObjOrder(g *d2graph.Graph, boardPath []string) ([]string, error)

func GetParentID

func GetParentID(g *d2graph.Graph, boardPath []string, absID string) (string, error)

func GetWriteableEdgeRefs added in v0.6.4

func GetWriteableEdgeRefs(edge *d2graph.Edge, writeableAST *d2ast.Map) (out []d2graph.EdgeReference)

func GetWriteableRefs added in v0.6.4

func GetWriteableRefs(obj *d2graph.Object, writeableAST *d2ast.Map) (out []d2graph.Reference)

func IsImportedEdge added in v0.6.4

func IsImportedEdge(ast *d2ast.Map, edge *d2graph.Edge) bool

Glob creations count as imported for now TODO Probably rename later

func IsImportedObj added in v0.6.4

func IsImportedObj(ast *d2ast.Map, obj *d2graph.Object) bool

func IsLabelKeyID

func IsLabelKeyID(key, label string) bool

func Move

func Move(g *d2graph.Graph, boardPath []string, key, newKey string, includeDescendants bool) (_ *d2graph.Graph, err error)

Does not handle edge keys, on account of edge keys can only be reserved, e.g. (a->b).style.color: red

func MoveIDDeltas

func MoveIDDeltas(g *d2graph.Graph, key, newKey string, includeDescendants bool) (deltas map[string]string, err error)

func ReconnectEdge added in v0.5.0

func ReconnectEdge(g *d2graph.Graph, boardPath []string, edgeKey string, srcKey, dstKey *string) (_ *d2graph.Graph, err error)

func ReconnectEdgeIDDeltas added in v0.5.0

func ReconnectEdgeIDDeltas(g *d2graph.Graph, boardPath []string, edgeKey string, srcKey, dstKey *string) (deltas map[string]string, err error)

func Rename

func Rename(g *d2graph.Graph, boardPath []string, key, newName string) (_ *d2graph.Graph, newKey string, err error)

func RenameIDDeltas

func RenameIDDeltas(g *d2graph.Graph, boardPath []string, key, newName string) (deltas map[string]string, err error)

func ReparentIDDelta

func ReparentIDDelta(g *d2graph.Graph, boardPath []string, key, parentKey string) (string, error)

func ReplaceBoardNode added in v0.6.0

func ReplaceBoardNode(ast, ast2 *d2ast.Map, boardPath []string) bool

func Set

func Set(g *d2graph.Graph, boardPath []string, key string, tag, value *string) (_ *d2graph.Graph, err error)

TODO: update graph in place when compiler can accept single modifications TODO: go through all references to decide best spot to insert something

Types

type OutsideScopeError added in v0.6.0

type OutsideScopeError struct{}

func (OutsideScopeError) Error added in v0.6.0

func (e OutsideScopeError) Error() string

Jump to

Keyboard shortcuts

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