Documentation
¶
Index ¶
- Constants
- Variables
- func DOTIDFromEntity(o space.Entity) (string, error)
- type DOTEdge
- type DOTGraph
- type DOTNode
- type DOTOption
- type DOTOptions
- type DOTer
- type Edge
- type Entity
- type Graph
- type LinkRemover
- type Node
- type NodeAdder
- type NodeLinker
- type NodeRemover
- type Object
- type Option
- type Options
- type Querier
- type SubGrapher
Constants ¶
View Source
const (
// DefaultWeight is default edge weight
DefaultWeight = 1.0
)
Variables ¶
View Source
var ( // ErrInvalidNode is returned when attempting to use an invalid node ErrInvalidNode = errors.New("ErrInvalidNode") // ErrNodeNotFound is returned when a node could not be found ErrNodeNotFound = errors.New("ErrNodeNotFound") // ErrEdgeNotFound is returned when an edge could not be found ErrEdgeNotFound = errors.New("ErrEdgeNotFound") // ErrEdgeNotExist is returned when an edge does not exist ErrEdgeNotExist = errors.New("ErrEdgeNotExist") // ErrDuplicateNode is returned by store when duplicate nodes are found ErrDuplicateNode = errors.New("ErrDuplicateNode") // ErrUnknownEntity is returned when requesting an unknown entity ErrUnknownEntity = errors.New("ErrUnknownEntity") // ErrInvalidEntity is returned when requesting an invalid entity ErrInvalidEntity = errors.New("ErrInvalidEntity") // ErrMissingEntity is returned when a graph query is missing entity ErrMissingEntity = errors.New("ErrMissingEntity") // ErrMissingResource is returned by when scrape.Object.Resource() is nil ErrMissingResource = errors.New("ErrMissingResource") // ErrNotImplemented is returned when requesting functionality that has not been implemented ErrNotImplemented = errors.New("ErrNotImplemented") // ErrUnsupported is returned when requesting unsupported functionality ErrUnsupported = errors.New("ErrUnsupported") )
Functions ¶
Types ¶
type DOTGraph ¶
type DOTGraph interface { Graph // DOTID returns grapph DOT ID. DOTID() string // DOTAttributers returns graph DOT attributes. DOTAttributers() (graph, node, edge encoding.Attributer) // DOT returns Graphviz DOT graph. DOT() (string, error) }
DOTGraph returns GraphViz DOT graph.
type DOTOptions ¶
DOTOptions are DOT graph options.
type DOTer ¶
type DOTer interface { // DOTID returns Graphviz DOT ID. DOTID() string // SetDOTID sets Graphviz DOT ID. SetDOTID(string) }
DOTer implements GraphViz DOT properties.
type Edge ¶
type Edge interface { Object // FromNode returns the from node of the edge. FromNode(context.Context) (Node, error) // ToNode returns the to node of the edge. ToNode(context.Context) (Node, error) // Weight returns edge weight. Weight() float64 }
Edge is an edge between two graph nodes.
type Graph ¶
type Graph interface { // UID returns graph uid. UID() uuid.UID // Node returns node with given uid. Node(context.Context, uuid.UID) (Node, error) // Nodes returns all graph nodes. Nodes(context.Context) ([]Node, error) // Edge returns the edge between the two nodes. Edge(ctx context.Context, from, to uuid.UID) (Edge, error) // Edges returns all graph edges. Edges(context.Context) ([]Edge, error) }
Graph is a graph of space entities.
type LinkRemover ¶
type LinkRemover interface { // RemoveEdge removes edge(s) from the graph. RemoveLink(ctx context.Context, from, to uuid.UID) error }
LinkRemover removes link between two Nodes.
type NodeAdder ¶
type NodeAdder interface { // NewNode returns a new Node. NewNode(context.Context, space.Entity, ...Option) (Node, error) // AddNode adds a new node to the graph. AddNode(context.Context, Node) error }
NodeAdder adds new Nodes to graph.
type NodeLinker ¶
type NodeLinker interface { // Link links two nodes and returns the new edge. Link(ctx context.Context, from, to uuid.UID, opts ...Option) (Edge, error) }
NodeLinker links arbitrary nodes in graph.
type NodeRemover ¶
type NodeRemover interface { // RemoveNode removes node from the graph. RemoveNode(context.Context, uuid.UID) error }
NodeRemover removes node from Grapg
type Option ¶ added in v0.0.3
type Option func(*Options)
Option configures Options.
func WithDOTOptions ¶ added in v0.0.3
func WithDOTOptions(do DOTOptions) Option
WithDOTOptions sets DOTOptions
type Options ¶
type Options struct { UID uuid.UID DOTID string Attrs attrs.Attrs Weight float64 DOTOptions DOTOptions }
Options are graph options.
Click to show internal directories.
Click to hide internal directories.