Documentation
¶
Index ¶
- Constants
- Variables
- func FindDataset(g CoreGraph, envid int, name []string) (id int, success bool)
- func FindEnvironment(g CoreGraph, props ps.Map) (envid int, success bool)
- func GenerateDot(g CoreGraph) []byte
- func GenericMerge(old, nu ps.Map) ps.Map
- func Identify(g CoreGraph, sd SplitData) int
- func Qbe(v ...interface{}) edgeFilter
- func Qbv(v ...interface{}) vertexFilter
- type CoreGraph
- type EFilter
- type EType
- type EdgeSpec
- type EdgeSpecs
- type Identifier
- type IdentifierComm
- type IdentifierCommit
- type IdentifierDataset
- type IdentifierEnvironment
- type IdentifierLogicState
- type IdentifierParentDataset
- type IdentifierProcess
- type IdentifierTestResult
- type IdentifierVcsLabel
- type PropQ
- type Property
- type SpecCommit
- type SpecDatasetHierarchy
- type SpecLocalLogic
- type SpecNetListener
- type SpecParentDataset
- type SpecUnixDomainListener
- type SplitData
- type Splitter
- type StandardEdge
- type VEFilter
- type VFilter
- type VType
- type Vertex
- type VertexTuple
Constants ¶
const ( VTypeNone VType = "" ETypeNone EType = "" )
Variables ¶
var Identifiers []Identifier
Functions ¶
func GenerateDot ¶
Generates a .dot-format representation of the given CoreGraph, suitable for rendering into output by graphviz (or other utilities).
Types ¶
type CoreGraph ¶
type CoreGraph interface {
// Merge a message into the graph, returning a pointer to the new graph
// that contains the resulting updates.
Merge(msg interpret.Message) CoreGraph
// Enumerates the outgoing edges from the ego vertex, limiting the result set
// to those that pass the provided filter (if any).
OutWith(egoId int, ef EFilter) (es []StandardEdge)
// Enumerates the incoming edges from the ego vertex, limiting the result set
// to those that pass the provided filter (if any).
InWith(egoId int, ef EFilter) (es []StandardEdge)
// Enumerates the successors (targets of outgoing edges) from the ego vertex,
// limiting the result set to those that pass the provided edge and vertex
// filters (if any).
SuccessorsWith(egoId int, vef VEFilter) (vts []VertexTuple)
// Enumerates the predecessors (sources of incoming edges) from the ego vertex,
// limiting the result set to those that pass the provided edge and vertex
// filters (if any).
PredecessorsWith(egoId int, vef VEFilter) (vts []VertexTuple)
// Enumerates the vertices that pass the provided vertex filter (if any).
VerticesWith(vf VFilter) (vs []VertexTuple)
// Gets the vertex tuple associated with a given id.
Get(id int) (VertexTuple, error)
// Returns the message id for the current version of the graph. The graph's
// contents are guaranteed to represent the state resulting from a correct
// in-order interpretation of the messages up to the id, inclusive.
MsgId() int
}
CoreGraph is the interface provided by pipeviz' main graph object.
It is a persistent/immutable datastructure: only the Merge() method is able to change the graph, but that method returns a pointer to a new graph rather than updating in-place. (These copies typically share structure for efficiency)
All other methods are read-only, and generally provide composable parts that work together to facilitate the creation of larger traversals/queries.
type EdgeSpec ¶
type EdgeSpec interface {
}
TODO for now, no structure to this. change to queryish form later
type Identifier ¶
Identifiers represent the logic for identifying specific types of objects that may be contained within the graph, and finding matches between these types of objects
type IdentifierComm ¶
type IdentifierComm struct{}
func (IdentifierComm) CanIdentify ¶
func (i IdentifierComm) CanIdentify(data Vertex) bool
type IdentifierCommit ¶
type IdentifierCommit struct{}
func (IdentifierCommit) CanIdentify ¶
func (i IdentifierCommit) CanIdentify(data Vertex) bool
type IdentifierDataset ¶
type IdentifierDataset struct{}
func (IdentifierDataset) CanIdentify ¶
func (i IdentifierDataset) CanIdentify(data Vertex) bool
type IdentifierEnvironment ¶
type IdentifierEnvironment struct{}
Identifier for Environments
func (IdentifierEnvironment) CanIdentify ¶
func (i IdentifierEnvironment) CanIdentify(data Vertex) bool
type IdentifierLogicState ¶
type IdentifierLogicState struct{}
func (IdentifierLogicState) CanIdentify ¶
func (i IdentifierLogicState) CanIdentify(data Vertex) bool
type IdentifierParentDataset ¶
type IdentifierParentDataset struct{}
func (IdentifierParentDataset) CanIdentify ¶
func (i IdentifierParentDataset) CanIdentify(data Vertex) bool
type IdentifierProcess ¶
type IdentifierProcess struct{}
func (IdentifierProcess) CanIdentify ¶
func (i IdentifierProcess) CanIdentify(data Vertex) bool
type IdentifierTestResult ¶
type IdentifierTestResult struct{}
func (IdentifierTestResult) CanIdentify ¶
func (i IdentifierTestResult) CanIdentify(data Vertex) bool
type IdentifierVcsLabel ¶
type IdentifierVcsLabel struct{}
func (IdentifierVcsLabel) CanIdentify ¶
func (i IdentifierVcsLabel) CanIdentify(data Vertex) bool
type PropQ ¶
type PropQ struct {
K string
V interface{}
}
Used in queries to specify property k/v pairs.
type Property ¶
type Property struct {
MsgSrc int `json:"msgsrc"`
Value interface{} `json:"value"`
}
type SpecCommit ¶
type SpecDatasetHierarchy ¶
type SpecDatasetHierarchy struct {
NamePath []string // path through the series of names that arrives at the final dataset
}
type SpecLocalLogic ¶
type SpecLocalLogic struct {
Path string
}
type SpecNetListener ¶
type SpecParentDataset ¶
type SpecParentDataset struct {
Name string
}
type SpecUnixDomainListener ¶
type SpecUnixDomainListener struct {
Path string
}
type StandardEdge ¶
type StandardEdge struct {
Source int
Target int
EType EType
// TODO do these *actually* need to be persistent structures?
Props ps.Map
// contains filtered or unexported fields
}
func Resolve ¶
func Resolve(g CoreGraph, mid int, src VertexTuple, d EdgeSpec) (StandardEdge, bool)
Attempts to resolve an EdgeSpec into a real edge. This process has two steps:
1. Finding the target node. 2. Seeing if this edge already exists between source and target.
It is the responsibility of the edge spec's type handler to determine what "if an edge already exists" means, as well as whether to overwrite/merge or duplicate the edge in such a case.
type Vertex ¶
type Vertex interface {
// Merges another vertex into this vertex. Error is indicated if the
// dynamic types do not match.
Merge(Vertex) (Vertex, error)
// Returns a string representing the object type. Used for namespacing keys, etc.
// While this is (currently) implemented as a method, its result must be invariant.
// TODO use string-const generator, other tricks to enforce invariance, compact space use
Typ() VType
// Returns a persistent map with the vertex's properties.
// TODO generate more type-restricted versions of the map?
Props() ps.Map
}
type VertexTuple ¶
type VertexTuple struct {
// contains filtered or unexported fields
}
func (VertexTuple) Flat ¶
func (vt VertexTuple) Flat() (flat flatVTuple)
flatten the persistent structures in the vtTuple down into conventional ones (typically for easy printing). TODO if this is gonna be exported, it's gotta be cleaned up
func (VertexTuple) OutEdges ¶
func (vt VertexTuple) OutEdges() []StandardEdge
Returns the out-edges of the vertex tuple.
func (VertexTuple) Vertex ¶
func (vt VertexTuple) Vertex() Vertex
Returns the vertex data of the vertex tuple.