Documentation
¶
Index ¶
- Constants
- Variables
- func UnmarshalWSMessage(msg shttp.WSMessage) (string, interface{}, error)
- type DefaultGraphListener
- func (c *DefaultGraphListener) OnEdgeAdded(e *Edge)
- func (c *DefaultGraphListener) OnEdgeDeleted(e *Edge)
- func (c *DefaultGraphListener) OnEdgeUpdated(e *Edge)
- func (c *DefaultGraphListener) OnNodeAdded(n *Node)
- func (c *DefaultGraphListener) OnNodeDeleted(n *Node)
- func (d *DefaultGraphListener) OnNodeUpdated(n *Node)
- type Edge
- func (e *Edge) Decode(i interface{}) error
- func (e *Edge) GetChild() Identifier
- func (e *Edge) GetParent() Identifier
- func (e *Edge) Host() string
- func (e *Edge) JsonRawMessage() *json.RawMessage
- func (e *Edge) MarshalJSON() ([]byte, error)
- func (e *Edge) MatchMetadata(f Metadata) bool
- func (e *Edge) Metadata() Metadata
- func (e *Edge) String() string
- type ElasticSearchBackend
- func (b *ElasticSearchBackend) AddEdge(e *Edge) bool
- func (b *ElasticSearchBackend) AddMetadata(i interface{}, k string, v interface{}) bool
- func (b *ElasticSearchBackend) AddNode(n *Node) bool
- func (b *ElasticSearchBackend) DelEdge(e *Edge) bool
- func (b *ElasticSearchBackend) DelNode(n *Node) bool
- func (b *ElasticSearchBackend) GetEdge(i Identifier, t *time.Time) *Edge
- func (b *ElasticSearchBackend) GetEdgeNodes(e *Edge, t *time.Time) (*Node, *Node)
- func (b *ElasticSearchBackend) GetEdges(t *time.Time, m Metadata) (edges []*Edge)
- func (b *ElasticSearchBackend) GetNode(i Identifier, t *time.Time) *Node
- func (b *ElasticSearchBackend) GetNodeEdges(n *Node, t *time.Time) (edges []*Edge)
- func (b *ElasticSearchBackend) GetNodes(t *time.Time, m Metadata) (nodes []*Node)
- func (b *ElasticSearchBackend) SetMetadata(i interface{}, m Metadata) bool
- func (b *ElasticSearchBackend) WithContext(graph *Graph, context GraphContext) (*Graph, error)
- type Forwarder
- type Graph
- func (g *Graph) AddEdge(e *Edge) bool
- func (g *Graph) AddEventListener(l GraphEventListener)
- func (g *Graph) AddMetadata(i interface{}, k string, v interface{}) bool
- func (g *Graph) AddNode(n *Node) bool
- func (g *Graph) AreLinked(n1 *Node, n2 *Node, m ...Metadata) bool
- func (g *Graph) DelEdge(e *Edge)
- func (g *Graph) DelHostGraph(host string)
- func (g *Graph) DelNode(n *Node)
- func (g *Graph) GetContext() GraphContext
- func (g *Graph) GetEdge(i Identifier) *Edge
- func (g *Graph) GetEdgeNodes(e *Edge) (*Node, *Node)
- func (g *Graph) GetEdges(m Metadata) []*Edge
- func (g *Graph) GetNode(i Identifier) *Node
- func (g *Graph) GetNodeEdges(n *Node) []*Edge
- func (g *Graph) GetNodes(m Metadata) []*Node
- func (g *Graph) Link(n1 *Node, n2 *Node, m ...Metadata) *Edge
- func (g *Graph) LookupChildren(n *Node, f Metadata, em ...Metadata) []*Node
- func (g *Graph) LookupEdges(pm Metadata, cm Metadata, em Metadata) []*Edge
- func (g *Graph) LookupFirstChild(n *Node, f Metadata) *Node
- func (g *Graph) LookupFirstNode(m Metadata) *Node
- func (g *Graph) LookupNodesFromKey(key string) []*Node
- func (g *Graph) LookupParents(n *Node, f Metadata, em ...Metadata) []*Node
- func (g *Graph) LookupShortestPath(n *Node, m Metadata, em ...Metadata) []*Node
- func (g *Graph) MarshalJSON() ([]byte, error)
- func (g *Graph) NewEdge(i Identifier, p *Node, c *Node, m Metadata) *Edge
- func (g *Graph) NewNode(i Identifier, m Metadata, h ...string) *Node
- func (g *Graph) RemoveEventListener(l GraphEventListener)
- func (g *Graph) Replace(o *Node, n *Node) *Node
- func (g *Graph) SetMetadata(i interface{}, m Metadata) bool
- func (g *Graph) StartMetadataTransaction(i interface{}) *MetadataTransaction
- func (g *Graph) String() string
- func (g *Graph) Unlink(n1 *Node, n2 *Node)
- func (g *Graph) WithContext(c GraphContext) (*Graph, error)
- type GraphBackend
- type GraphContext
- type GraphEventListener
- type GraphServer
- func (s *GraphServer) OnEdgeAdded(e *Edge)
- func (s *GraphServer) OnEdgeDeleted(e *Edge)
- func (s *GraphServer) OnEdgeUpdated(e *Edge)
- func (s *GraphServer) OnMessage(c *shttp.WSClient, msg shttp.WSMessage)
- func (s *GraphServer) OnNodeAdded(n *Node)
- func (s *GraphServer) OnNodeDeleted(n *Node)
- func (s *GraphServer) OnNodeUpdated(n *Node)
- func (s *GraphServer) OnUnregisterClient(c *shttp.WSClient)
- type HostNodeTIDMap
- type Identifier
- type MemoryBackend
- func (m MemoryBackend) AddEdge(e *Edge) bool
- func (m MemoryBackend) AddMetadata(i interface{}, k string, v interface{}) bool
- func (m MemoryBackend) AddNode(n *Node) bool
- func (m MemoryBackend) DelEdge(e *Edge) bool
- func (m MemoryBackend) DelNode(n *Node) bool
- func (m MemoryBackend) GetEdge(i Identifier, t *time.Time) *Edge
- func (m MemoryBackend) GetEdgeNodes(e *Edge, t *time.Time) (*Node, *Node)
- func (m MemoryBackend) GetEdges(t *time.Time, metadata Metadata) []*Edge
- func (m MemoryBackend) GetNode(i Identifier, t *time.Time) *Node
- func (m MemoryBackend) GetNodeEdges(n *Node, t *time.Time) []*Edge
- func (m MemoryBackend) GetNodes(t *time.Time, metadata Metadata) []*Node
- func (m MemoryBackend) SetMetadata(i interface{}, meta Metadata) bool
- func (m MemoryBackend) WithContext(graph *Graph, context GraphContext) (*Graph, error)
- type MemoryBackendEdge
- type MemoryBackendNode
- type Metadata
- type MetadataMatcher
- type MetadataTransaction
- type Node
- type OrientDBBackend
- func (o *OrientDBBackend) AddEdge(e *Edge) bool
- func (o *OrientDBBackend) AddMetadata(i interface{}, k string, v interface{}) bool
- func (o *OrientDBBackend) AddNode(n *Node) bool
- func (o *OrientDBBackend) DelEdge(e *Edge) bool
- func (o *OrientDBBackend) DelNode(n *Node) bool
- func (o *OrientDBBackend) GetEdge(i Identifier, t *time.Time) *Edge
- func (o *OrientDBBackend) GetEdgeNodes(e *Edge, t *time.Time) (n1 *Node, n2 *Node)
- func (o *OrientDBBackend) GetEdges(t *time.Time, m Metadata) (edges []*Edge)
- func (o *OrientDBBackend) GetNode(i Identifier, t *time.Time) *Node
- func (o *OrientDBBackend) GetNodeEdges(n *Node, t *time.Time) (edges []*Edge)
- func (o *OrientDBBackend) GetNodes(t *time.Time, m Metadata) (nodes []*Node)
- func (o *OrientDBBackend) SetMetadata(i interface{}, m Metadata) bool
- func (o *OrientDBBackend) WithContext(graph *Graph, context GraphContext) (*Graph, error)
- type ShadowedBackend
- func (c *ShadowedBackend) AddEdge(e *Edge) bool
- func (c *ShadowedBackend) AddMetadata(i interface{}, k string, v interface{}) bool
- func (c *ShadowedBackend) AddNode(n *Node) bool
- func (c *ShadowedBackend) DelEdge(e *Edge) bool
- func (c *ShadowedBackend) DelNode(n *Node) bool
- func (c *ShadowedBackend) GetEdge(i Identifier, t *time.Time) *Edge
- func (c *ShadowedBackend) GetEdgeNodes(e *Edge, t *time.Time) (*Node, *Node)
- func (c *ShadowedBackend) GetEdges(t *time.Time, m Metadata) []*Edge
- func (c *ShadowedBackend) GetNode(i Identifier, t *time.Time) *Node
- func (c *ShadowedBackend) GetNodeEdges(n *Node, t *time.Time) (edges []*Edge)
- func (c *ShadowedBackend) GetNodes(t *time.Time, m Metadata) []*Node
- func (c *ShadowedBackend) SetMetadata(i interface{}, metadata Metadata) bool
- func (c *ShadowedBackend) WithContext(graph *Graph, context GraphContext) (*Graph, error)
Constants ¶
View Source
const (
Namespace = "Graph"
)
Variables ¶
Functions ¶
Types ¶
type DefaultGraphListener ¶
type DefaultGraphListener struct {
}
default implementation of a graph listener, can be used when not implementing the whole set of callbacks
func (*DefaultGraphListener) OnEdgeAdded ¶
func (c *DefaultGraphListener) OnEdgeAdded(e *Edge)
func (*DefaultGraphListener) OnEdgeDeleted ¶
func (c *DefaultGraphListener) OnEdgeDeleted(e *Edge)
func (*DefaultGraphListener) OnEdgeUpdated ¶
func (c *DefaultGraphListener) OnEdgeUpdated(e *Edge)
func (*DefaultGraphListener) OnNodeAdded ¶
func (c *DefaultGraphListener) OnNodeAdded(n *Node)
func (*DefaultGraphListener) OnNodeDeleted ¶
func (c *DefaultGraphListener) OnNodeDeleted(n *Node)
func (*DefaultGraphListener) OnNodeUpdated ¶
func (d *DefaultGraphListener) OnNodeUpdated(n *Node)
type Edge ¶
type Edge struct {
// contains filtered or unexported fields
}
func (*Edge) GetChild ¶
func (e *Edge) GetChild() Identifier
func (*Edge) GetParent ¶
func (e *Edge) GetParent() Identifier
func (*Edge) JsonRawMessage ¶
func (e *Edge) JsonRawMessage() *json.RawMessage
type ElasticSearchBackend ¶ added in v0.9.0
type ElasticSearchBackend struct {
// contains filtered or unexported fields
}
func NewElasticSearchBackend ¶ added in v0.9.0
func NewElasticSearchBackendFromConfig ¶ added in v0.9.0
func NewElasticSearchBackendFromConfig() (*ElasticSearchBackend, error)
func (*ElasticSearchBackend) AddEdge ¶ added in v0.9.0
func (b *ElasticSearchBackend) AddEdge(e *Edge) bool
func (*ElasticSearchBackend) AddMetadata ¶ added in v0.9.0
func (b *ElasticSearchBackend) AddMetadata(i interface{}, k string, v interface{}) bool
func (*ElasticSearchBackend) AddNode ¶ added in v0.9.0
func (b *ElasticSearchBackend) AddNode(n *Node) bool
func (*ElasticSearchBackend) DelEdge ¶ added in v0.9.0
func (b *ElasticSearchBackend) DelEdge(e *Edge) bool
func (*ElasticSearchBackend) DelNode ¶ added in v0.9.0
func (b *ElasticSearchBackend) DelNode(n *Node) bool
func (*ElasticSearchBackend) GetEdge ¶ added in v0.9.0
func (b *ElasticSearchBackend) GetEdge(i Identifier, t *time.Time) *Edge
func (*ElasticSearchBackend) GetEdgeNodes ¶ added in v0.9.0
func (*ElasticSearchBackend) GetEdges ¶ added in v0.9.0
func (b *ElasticSearchBackend) GetEdges(t *time.Time, m Metadata) (edges []*Edge)
func (*ElasticSearchBackend) GetNode ¶ added in v0.9.0
func (b *ElasticSearchBackend) GetNode(i Identifier, t *time.Time) *Node
func (*ElasticSearchBackend) GetNodeEdges ¶ added in v0.9.0
func (b *ElasticSearchBackend) GetNodeEdges(n *Node, t *time.Time) (edges []*Edge)
func (*ElasticSearchBackend) GetNodes ¶ added in v0.9.0
func (b *ElasticSearchBackend) GetNodes(t *time.Time, m Metadata) (nodes []*Node)
func (*ElasticSearchBackend) SetMetadata ¶ added in v0.9.0
func (b *ElasticSearchBackend) SetMetadata(i interface{}, m Metadata) bool
func (*ElasticSearchBackend) WithContext ¶ added in v0.9.0
func (b *ElasticSearchBackend) WithContext(graph *Graph, context GraphContext) (*Graph, error)
type Forwarder ¶
type Forwarder struct {
shttp.DefaultWSClientEventHandler
Client *shttp.WSAsyncClient
Graph *Graph
Host string
}
type Graph ¶
func NewGraph ¶
func NewGraph(hostID string, backend GraphBackend) *Graph
func NewGraphFromConfig ¶
func NewGraphFromConfig(backend GraphBackend) *Graph
func NewGraphWithContext ¶
func NewGraphWithContext(hostID string, backend GraphBackend, context GraphContext) (*Graph, error)
func (*Graph) AddEventListener ¶
func (g *Graph) AddEventListener(l GraphEventListener)
func (*Graph) AddMetadata ¶
func (*Graph) GetContext ¶
func (g *Graph) GetContext() GraphContext
func (*Graph) GetEdge ¶
func (g *Graph) GetEdge(i Identifier) *Edge
func (*Graph) GetNode ¶
func (g *Graph) GetNode(i Identifier) *Node
func (*Graph) LookupChildren ¶
func (*Graph) LookupEdges ¶ added in v0.9.0
func (*Graph) LookupParents ¶ added in v0.9.0
func (*Graph) LookupShortestPath ¶
func (*Graph) RemoveEventListener ¶
func (g *Graph) RemoveEventListener(l GraphEventListener)
func (*Graph) StartMetadataTransaction ¶
func (g *Graph) StartMetadataTransaction(i interface{}) *MetadataTransaction
func (*Graph) WithContext ¶
func (g *Graph) WithContext(c GraphContext) (*Graph, error)
type GraphBackend ¶
type GraphBackend interface {
AddNode(n *Node) bool
DelNode(n *Node) bool
GetNode(i Identifier, at *time.Time) *Node
GetNodeEdges(n *Node, at *time.Time) []*Edge
AddEdge(e *Edge) bool
DelEdge(e *Edge) bool
GetEdge(i Identifier, at *time.Time) *Edge
GetEdgeNodes(e *Edge, at *time.Time) (*Node, *Node)
AddMetadata(e interface{}, k string, v interface{}) bool
SetMetadata(e interface{}, m Metadata) bool
GetNodes(at *time.Time, m Metadata) []*Node
GetEdges(at *time.Time, m Metadata) []*Edge
WithContext(graph *Graph, context GraphContext) (*Graph, error)
}
func BackendFromConfig ¶
func BackendFromConfig() (backend GraphBackend, err error)
type GraphContext ¶
func (*GraphContext) GetTime ¶
func (c *GraphContext) GetTime() *time.Time
type GraphEventListener ¶
type GraphServer ¶
type GraphServer struct {
shttp.DefaultWSServerEventHandler
WSServer *shttp.WSServer
Graph *Graph
}
func NewServer ¶
func NewServer(g *Graph, server *shttp.WSServer) *GraphServer
func (*GraphServer) OnEdgeAdded ¶
func (s *GraphServer) OnEdgeAdded(e *Edge)
func (*GraphServer) OnEdgeDeleted ¶
func (s *GraphServer) OnEdgeDeleted(e *Edge)
func (*GraphServer) OnEdgeUpdated ¶
func (s *GraphServer) OnEdgeUpdated(e *Edge)
func (*GraphServer) OnMessage ¶
func (s *GraphServer) OnMessage(c *shttp.WSClient, msg shttp.WSMessage)
func (*GraphServer) OnNodeAdded ¶
func (s *GraphServer) OnNodeAdded(n *Node)
func (*GraphServer) OnNodeDeleted ¶
func (s *GraphServer) OnNodeDeleted(n *Node)
func (*GraphServer) OnNodeUpdated ¶
func (s *GraphServer) OnNodeUpdated(n *Node)
func (*GraphServer) OnUnregisterClient ¶ added in v0.9.0
func (s *GraphServer) OnUnregisterClient(c *shttp.WSClient)
type HostNodeTIDMap ¶ added in v0.9.0
func BuildHostNodeTIDMap ¶ added in v0.9.0
func BuildHostNodeTIDMap(nodes []*Node) HostNodeTIDMap
type MemoryBackend ¶
type MemoryBackend struct {
// contains filtered or unexported fields
}
func NewMemoryBackend ¶
func NewMemoryBackend() (*MemoryBackend, error)
func (MemoryBackend) AddEdge ¶
func (m MemoryBackend) AddEdge(e *Edge) bool
func (MemoryBackend) AddMetadata ¶
func (m MemoryBackend) AddMetadata(i interface{}, k string, v interface{}) bool
func (MemoryBackend) AddNode ¶
func (m MemoryBackend) AddNode(n *Node) bool
func (MemoryBackend) DelEdge ¶
func (m MemoryBackend) DelEdge(e *Edge) bool
func (MemoryBackend) DelNode ¶
func (m MemoryBackend) DelNode(n *Node) bool
func (MemoryBackend) GetEdge ¶
func (m MemoryBackend) GetEdge(i Identifier, t *time.Time) *Edge
func (MemoryBackend) GetEdgeNodes ¶
func (MemoryBackend) GetEdges ¶
func (m MemoryBackend) GetEdges(t *time.Time, metadata Metadata) []*Edge
func (MemoryBackend) GetNode ¶
func (m MemoryBackend) GetNode(i Identifier, t *time.Time) *Node
func (MemoryBackend) GetNodeEdges ¶
func (m MemoryBackend) GetNodeEdges(n *Node, t *time.Time) []*Edge
func (MemoryBackend) GetNodes ¶
func (m MemoryBackend) GetNodes(t *time.Time, metadata Metadata) []*Node
func (MemoryBackend) SetMetadata ¶
func (m MemoryBackend) SetMetadata(i interface{}, meta Metadata) bool
func (MemoryBackend) WithContext ¶ added in v0.9.0
func (m MemoryBackend) WithContext(graph *Graph, context GraphContext) (*Graph, error)
type MemoryBackendNode ¶
type MemoryBackendNode struct {
*Node
// contains filtered or unexported fields
}
type MetadataTransaction ¶
type MetadataTransaction struct {
// contains filtered or unexported fields
}
func (*MetadataTransaction) AddMetadata ¶
func (t *MetadataTransaction) AddMetadata(k string, v interface{})
func (*MetadataTransaction) Commit ¶
func (t *MetadataTransaction) Commit()
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func (*Node) JsonRawMessage ¶
func (n *Node) JsonRawMessage() *json.RawMessage
type OrientDBBackend ¶
type OrientDBBackend struct {
// contains filtered or unexported fields
}
func NewOrientDBBackend ¶
func NewOrientDBBackendFromConfig ¶
func NewOrientDBBackendFromConfig() (*OrientDBBackend, error)
func (*OrientDBBackend) AddEdge ¶
func (o *OrientDBBackend) AddEdge(e *Edge) bool
func (*OrientDBBackend) AddMetadata ¶
func (o *OrientDBBackend) AddMetadata(i interface{}, k string, v interface{}) bool
func (*OrientDBBackend) AddNode ¶
func (o *OrientDBBackend) AddNode(n *Node) bool
func (*OrientDBBackend) DelEdge ¶
func (o *OrientDBBackend) DelEdge(e *Edge) bool
func (*OrientDBBackend) DelNode ¶
func (o *OrientDBBackend) DelNode(n *Node) bool
func (*OrientDBBackend) GetEdge ¶
func (o *OrientDBBackend) GetEdge(i Identifier, t *time.Time) *Edge
func (*OrientDBBackend) GetEdgeNodes ¶
func (*OrientDBBackend) GetEdges ¶
func (o *OrientDBBackend) GetEdges(t *time.Time, m Metadata) (edges []*Edge)
func (*OrientDBBackend) GetNode ¶
func (o *OrientDBBackend) GetNode(i Identifier, t *time.Time) *Node
func (*OrientDBBackend) GetNodeEdges ¶
func (o *OrientDBBackend) GetNodeEdges(n *Node, t *time.Time) (edges []*Edge)
func (*OrientDBBackend) GetNodes ¶
func (o *OrientDBBackend) GetNodes(t *time.Time, m Metadata) (nodes []*Node)
func (*OrientDBBackend) SetMetadata ¶
func (o *OrientDBBackend) SetMetadata(i interface{}, m Metadata) bool
func (*OrientDBBackend) WithContext ¶ added in v0.9.0
func (o *OrientDBBackend) WithContext(graph *Graph, context GraphContext) (*Graph, error)
type ShadowedBackend ¶ added in v0.9.0
type ShadowedBackend struct {
// contains filtered or unexported fields
}
func NewShadowedBackend ¶ added in v0.9.0
func NewShadowedBackend(persistent GraphBackend) (*ShadowedBackend, error)
func (*ShadowedBackend) AddEdge ¶ added in v0.9.0
func (c *ShadowedBackend) AddEdge(e *Edge) bool
func (*ShadowedBackend) AddMetadata ¶ added in v0.9.0
func (c *ShadowedBackend) AddMetadata(i interface{}, k string, v interface{}) bool
func (*ShadowedBackend) AddNode ¶ added in v0.9.0
func (c *ShadowedBackend) AddNode(n *Node) bool
func (*ShadowedBackend) DelEdge ¶ added in v0.9.0
func (c *ShadowedBackend) DelEdge(e *Edge) bool
func (*ShadowedBackend) DelNode ¶ added in v0.9.0
func (c *ShadowedBackend) DelNode(n *Node) bool
func (*ShadowedBackend) GetEdge ¶ added in v0.9.0
func (c *ShadowedBackend) GetEdge(i Identifier, t *time.Time) *Edge
func (*ShadowedBackend) GetEdgeNodes ¶ added in v0.9.0
func (*ShadowedBackend) GetEdges ¶ added in v0.9.0
func (c *ShadowedBackend) GetEdges(t *time.Time, m Metadata) []*Edge
func (*ShadowedBackend) GetNode ¶ added in v0.9.0
func (c *ShadowedBackend) GetNode(i Identifier, t *time.Time) *Node
func (*ShadowedBackend) GetNodeEdges ¶ added in v0.9.0
func (c *ShadowedBackend) GetNodeEdges(n *Node, t *time.Time) (edges []*Edge)
func (*ShadowedBackend) GetNodes ¶ added in v0.9.0
func (c *ShadowedBackend) GetNodes(t *time.Time, m Metadata) []*Node
func (*ShadowedBackend) SetMetadata ¶ added in v0.9.0
func (c *ShadowedBackend) SetMetadata(i interface{}, metadata Metadata) bool
func (*ShadowedBackend) WithContext ¶ added in v0.9.0
func (c *ShadowedBackend) WithContext(graph *Graph, context GraphContext) (*Graph, error)
Source Files
¶
- elasticsearch.go
- forwarder.go
- graph.go
- memory.go
- orientdb.go
- server.go
- shadowedbackend.go
Click to show internal directories.
Click to hide internal directories.