Documentation
¶
Index ¶
- type Edge
- type EdgeKind
- type EdgeKindDef
- type Graph
- func (graph *Graph) AddEdge(kind EdgeKind, start NodeId, end NodeId, props ...Properties) (*Edge, error)
- func (graph *Graph) AddNode(id NodeId, kinds []NodeKind, props Properties) (*Node, error)
- func (graph *Graph) MarshalJSON() ([]byte, error)
- func (graph *Graph) Merge(other *Graph)
- func (graph *Graph) ToJSON(sorted bool) ([]byte, error)
- type Node
- type NodeId
- type NodeKind
- type NodeKindDef
- type Properties
- type Relation
- type Schema
- func (s *Schema) AddEdgeKind(kind EdgeKind, description string, traversable bool, relations ...Relation) EdgeKind
- func (s *Schema) AddEnvironment(envKind, sourceKind NodeKind, principalKinds ...NodeKind) *Schema
- func (s *Schema) AddNodeKind(kind NodeKind, displayName, description, icon, color string, isDisplay bool) NodeKind
- func (s *Schema) DeriveFrom(g *Graph, lookup func(*Edge, *Node, *Node) (Relation, error), ...) *Schema
- func (s *Schema) EdgeKindDefs() []*EdgeKindDef
- func (s *Schema) Extend(nodeKinds []*NodeKindDef, relations ...Relation) *Schema
- func (s *Schema) Filter(pred func(Relation) bool) *Schema
- func (s *Schema) Neighbourhood(kind NodeKind) *Schema
- func (s *Schema) NodeKindDefs() []*NodeKindDef
- func (s *Schema) Relations() []Relation
- func (s *Schema) ToModelJSON() ([]byte, error)
- func (s *Schema) ToSchemaJSON() ([]byte, error)
- func (s *Schema) Types() []*NodeKindDef
- type SchemaEnvironment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EdgeKindDef ¶
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
func (*Graph) MarshalJSON ¶
type Node ¶
type Node struct {
ID NodeId `json:"id"`
Kinds []NodeKind `json:"kinds"`
Properties Properties `json:"properties,omitempty"`
}
type NodeKindDef ¶
type Properties ¶
type Schema ¶
type Schema struct {
BaseKind NodeKind
Name string
DisplayName string
Version string
Namespace string
// contains filtered or unexported fields
}
func (*Schema) AddEdgeKind ¶
func (*Schema) AddEnvironment ¶
func (*Schema) AddNodeKind ¶
func (*Schema) DeriveFrom ¶
func (s *Schema) DeriveFrom(g *Graph, lookup func(*Edge, *Node, *Node) (Relation, error), extra ...*NodeKindDef) *Schema
DeriveFrom returns a new Schema that copies all static kind definitions from s, merges any extra node kind definitions, and populates relations by walking the edges in g. The original schema s is not modified.
func (*Schema) EdgeKindDefs ¶
func (s *Schema) EdgeKindDefs() []*EdgeKindDef
func (*Schema) Extend ¶
func (s *Schema) Extend(nodeKinds []*NodeKindDef, relations ...Relation) *Schema
Extend returns a new Schema that copies all kind definitions from s and appends the given extra node kind definitions and relations. The original schema is not modified.
func (*Schema) Filter ¶
Filter returns a new Schema containing only the relations for which pred returns true, and the node kind definitions referenced by those relations.
func (*Schema) Neighbourhood ¶
Neighbourhood returns a new Schema containing only the relations where kind appears as start or end, and the node kind definitions referenced by those relations.
func (*Schema) NodeKindDefs ¶
func (s *Schema) NodeKindDefs() []*NodeKindDef
func (*Schema) ToModelJSON ¶
ToModelJSON produces the BloodHound custom_types registration payload.
func (*Schema) ToSchemaJSON ¶
ToSchemaJSON produces the full schema.json document.
func (*Schema) Types ¶
func (s *Schema) Types() []*NodeKindDef
Types returns the node kind definitions for all kinds that appear in the derived relations. If no relations have been derived, all registered kinds are returned. Kinds not present in the schema registry are returned with minimal definitions.