dsgraph

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package dsgraph is a placeholder package for linking queries, resources, and metadata until proper packaging & architectural decisions can be made

Index

Constants

This section is empty.

Variables

View Source
var (
	// NtDataset is a holistic reference to a dataset,
	// aka the base hash of a dataset
	NtDataset = NodeType("dataset")
	// NtAbstDataset is the abstract form of a dataset
	NtAbstDataset = NodeType("abst_dataset")
	// NtMetadata is the dataset.json file in a dataset
	NtMetadata = NodeType("metadata")
	// NtCommit is the commit.json file in a dataset
	NtCommit = NodeType("commit")
	// NtData is a dataset's raw data
	NtData = NodeType("data")
	// NtTransform is the transform.json in a dataset
	NtTransform = NodeType("transform")
	// NtAbstTransform is the abstract_transform.json in a dataset
	NtAbstTransform = NodeType("abst_transform")
	// NtStructure is the structure.json in a dataset
	NtStructure = NodeType("structure")
	// NtAbstStructure is the abstract_structure.json in a dataset
	NtAbstStructure = NodeType("abst_structure")
	// NtNamespace is the namespace of a single qri repository
	NtNamespace = NodeType("namespace")
)

Functions

func Walk

func Walk(node *Node, depth int, visit func(n *Node) error) error

Walk visits node and all descendants with a provided visit function

Types

type Link struct {
	// Type     LinkType
	From, To *Node
}

Link is a typed, directional connection from one node to another

func (Link) Equal

func (a Link) Equal(b Link) bool

Equal checks for field-level equality with another Link

type Node

type Node struct {
	Type  NodeType
	Path  string
	Links []Link
}

Node is a typed reference to a path

func FilterNodeTypes

func FilterNodeTypes(graph *Node, nodetypes ...NodeType) (nodes []*Node)

FilterNodeTypes returns a slice of node pointers from a graph that match the provided NodeType's

func (n *Node) AddLinks(links ...Link)

AddLinks is a no-duplicates method for adding one or more links to a node

func (Node) Equal

func (n Node) Equal(b *Node) bool

Equal checks for field-level equality with another Node

type NodeType

type NodeType string

NodeType specifies different types of qri nodes

type TransformResults

type TransformResults map[datastore.Key][]datastore.Key

TransformResults graphs transform paths to result paths

func (TransformResults) AddResult

func (qr TransformResults) AddResult(transform, result datastore.Key)

AddResult adds a result to the TransformResults map

func (TransformResults) MarshalJSON

func (qr TransformResults) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for TransformResults

func (*TransformResults) UnmarshalJSON

func (qr *TransformResults) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for TransformResults

Jump to

Keyboard shortcuts

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