Documentation ¶
Index ¶
- func ConvertGraphData(item *GraphData) (*graphstore.Node, *graphstore.Edge, error)
- type Driver
- type Encoding
- type GraphData
- type GraphStoreServer
- func (s *GraphStoreServer) Delete(ctx context.Context, request *graphstore.DeleteRequest) (*graphstore.DeleteResponse, error)
- func (s *GraphStoreServer) List(ctx context.Context, request *graphstore.ListRequest) (*graphstore.ListResponse, error)
- func (s *GraphStoreServer) Neighbors(ctx context.Context, request *graphstore.NeighborsRequest) (*graphstore.NeighborsResponse, error)
- func (s *GraphStoreServer) Put(ctx context.Context, request *graphstore.PutRequest) (*graphstore.PutResponse, error)
- func (s *GraphStoreServer) Traverse(traverseServer graphstore.GraphStore_TraverseServer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertGraphData ¶
func ConvertGraphData(item *GraphData) (*graphstore.Node, *graphstore.Edge, error)
ConvertGraphData transforms itself back into a node or an edge
Types ¶
type Driver ¶
type Driver interface { Put(ctx context.Context, data []*GraphData) error Delete(ctx context.Context, data []*GraphData) error List(ctx context.Context, kind string, offset, limit int) ([]*GraphData, bool, error) NeighborsTo(ctx context.Context, toKeys []string) ([]*GraphData, error) NeighborsFrom(ctx context.Context, fromKeys []string) ([]*GraphData, error) }
Driver represents a generic interface for storing a graph.
func NewSQLDriver ¶
func NewSQLDriver(rwdb, rodb *sqlx.DB, statements *core.Statements) Driver
type GraphData ¶
type GraphData struct { K1 string `json:"k1" db:"k1" gorm:"column:k1;type:varchar(64);primaryKey;index:secondary,priority:2"` K2 string `json:"k2" db:"k2" gorm:"column:k2;type:varchar(64);primaryKey;index:secondary,priority:1"` K3 string `json:"k3" db:"k3" gorm:"column:k3;type:varchar(64);primaryKey;index:secondary,priority:3"` Kind string `json:"kind" db:"kind" gorm:"column:kind;type:varchar(255);index:kind"` Encoding Encoding `json:"encoding" db:"encoding" gorm:"column:encoding"` Data string `json:"data" db:"data" gorm:"column:data;type:text"` DateDeleted *sql.NullTime `json:"dateDeleted" db:"date_deleted" gorm:"column:date_deleted;index:date_deleted"` LastModified time.Time `json:"lastModified" db:"last_modified" gorm:"column:last_modified;index:last_modified"` }
GraphData describes how the data is stored
func ConvertEdge ¶
func ConvertEdge(edge *graphstore.Edge, encoding Encoding) *GraphData
ConvertEdge transforms an Edge to a generalized graph item
func ConvertNode ¶
func ConvertNode(node *graphstore.Node, encoding Encoding) *GraphData
ConvertNode transforms a Node to a generalized graph item
type GraphStoreServer ¶
type GraphStoreServer struct { graphstore.UnsafeGraphStoreServer Driver Driver }
GraphStoreServer encapsulates the logic for storing a graph using a generic driver.
func (*GraphStoreServer) Delete ¶
func (s *GraphStoreServer) Delete(ctx context.Context, request *graphstore.DeleteRequest) (*graphstore.DeleteResponse, error)
Delete ...
func (*GraphStoreServer) List ¶
func (s *GraphStoreServer) List(ctx context.Context, request *graphstore.ListRequest) (*graphstore.ListResponse, error)
List ...
func (*GraphStoreServer) Neighbors ¶
func (s *GraphStoreServer) Neighbors(ctx context.Context, request *graphstore.NeighborsRequest) (*graphstore.NeighborsResponse, error)
Neighbors ...
func (*GraphStoreServer) Put ¶
func (s *GraphStoreServer) Put(ctx context.Context, request *graphstore.PutRequest) (*graphstore.PutResponse, error)
Put ...
func (*GraphStoreServer) Traverse ¶
func (s *GraphStoreServer) Traverse(traverseServer graphstore.GraphStore_TraverseServer) error
Traverse ...
Click to show internal directories.
Click to hide internal directories.