service

package
v0.0.0-...-ee3ee60 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_service_proto protoreflect.FileDescriptor

Functions

func NewGraphEndpoints

func NewGraphEndpoints() []*api.Endpoint

func RegisterGraphHandler

func RegisterGraphHandler(s server.Server, hdlr GraphHandler, opts ...server.HandlerOption) error

Types

type DumpReq

type DumpReq struct {

	// Starting node for a subgraph. If omitted then the entire graph is dumped.
	NodeUid string `protobuf:"bytes,1,opt,name=node_uid,json=nodeUid,proto3" json:"node_uid,omitempty"`
	// How many levels to return. If omitted then the no limit is applied.
	Levels int32 `protobuf:"varint,2,opt,name=levels,proto3" json:"levels,omitempty"`
	// contains filtered or unexported fields
}

DumpReq is a request to producting a graph dump.

func (*DumpReq) Descriptor deprecated

func (*DumpReq) Descriptor() ([]byte, []int)

Deprecated: Use DumpReq.ProtoReflect.Descriptor instead.

func (*DumpReq) GetLevels

func (x *DumpReq) GetLevels() int32

func (*DumpReq) GetNodeUid

func (x *DumpReq) GetNodeUid() string

func (*DumpReq) ProtoMessage

func (*DumpReq) ProtoMessage()

func (*DumpReq) ProtoReflect

func (x *DumpReq) ProtoReflect() protoreflect.Message

func (*DumpReq) Reset

func (x *DumpReq) Reset()

func (*DumpReq) String

func (x *DumpReq) String() string

type DumpResp

type DumpResp struct {
	Nodes []*NodeResp `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"`
	Edges []*EdgeResp `protobuf:"bytes,2,rep,name=edges,proto3" json:"edges,omitempty"`
	// contains filtered or unexported fields
}

DumpResp is a graph dump response.

func (*DumpResp) Descriptor deprecated

func (*DumpResp) Descriptor() ([]byte, []int)

Deprecated: Use DumpResp.ProtoReflect.Descriptor instead.

func (*DumpResp) GetEdges

func (x *DumpResp) GetEdges() []*EdgeResp

func (*DumpResp) GetNodes

func (x *DumpResp) GetNodes() []*NodeResp

func (*DumpResp) ProtoMessage

func (*DumpResp) ProtoMessage()

func (*DumpResp) ProtoReflect

func (x *DumpResp) ProtoReflect() protoreflect.Message

func (*DumpResp) Reset

func (x *DumpResp) Reset()

func (*DumpResp) String

func (x *DumpResp) String() string

type EdgeReq

type EdgeReq struct {
	Uid        string            `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	SourceUid  string            `protobuf:"bytes,3,opt,name=source_uid,json=sourceUid,proto3" json:"source_uid,omitempty"`
	Label      string            `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
	TargetUid  string            `protobuf:"bytes,4,opt,name=target_uid,json=targetUid,proto3" json:"target_uid,omitempty"`
	Properties map[string][]byte `` /* 161-byte string literal not displayed */
	// contains filtered or unexported fields
}

EdgeReq is a edge request.

func (*EdgeReq) Descriptor deprecated

func (*EdgeReq) Descriptor() ([]byte, []int)

Deprecated: Use EdgeReq.ProtoReflect.Descriptor instead.

func (*EdgeReq) GetLabel

func (x *EdgeReq) GetLabel() string

func (*EdgeReq) GetProperties

func (x *EdgeReq) GetProperties() map[string][]byte

func (*EdgeReq) GetSourceUid

func (x *EdgeReq) GetSourceUid() string

func (*EdgeReq) GetTargetUid

func (x *EdgeReq) GetTargetUid() string

func (*EdgeReq) GetUid

func (x *EdgeReq) GetUid() string

func (*EdgeReq) ProtoMessage

func (*EdgeReq) ProtoMessage()

func (*EdgeReq) ProtoReflect

func (x *EdgeReq) ProtoReflect() protoreflect.Message

func (*EdgeReq) Reset

func (x *EdgeReq) Reset()

func (*EdgeReq) String

func (x *EdgeReq) String() string

type EdgeResp

type EdgeResp struct {
	Uid        string            `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	SourceUid  string            `protobuf:"bytes,3,opt,name=source_uid,json=sourceUid,proto3" json:"source_uid,omitempty"`
	Label      string            `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
	TargetUid  string            `protobuf:"bytes,4,opt,name=target_uid,json=targetUid,proto3" json:"target_uid,omitempty"`
	Properties map[string][]byte `` /* 161-byte string literal not displayed */
	// contains filtered or unexported fields
}

EdgeResp is a edge response.

func (*EdgeResp) Descriptor deprecated

func (*EdgeResp) Descriptor() ([]byte, []int)

Deprecated: Use EdgeResp.ProtoReflect.Descriptor instead.

func (*EdgeResp) GetLabel

func (x *EdgeResp) GetLabel() string

func (*EdgeResp) GetProperties

func (x *EdgeResp) GetProperties() map[string][]byte

func (*EdgeResp) GetSourceUid

func (x *EdgeResp) GetSourceUid() string

func (*EdgeResp) GetTargetUid

func (x *EdgeResp) GetTargetUid() string

func (*EdgeResp) GetUid

func (x *EdgeResp) GetUid() string

func (*EdgeResp) ProtoMessage

func (*EdgeResp) ProtoMessage()

func (*EdgeResp) ProtoReflect

func (x *EdgeResp) ProtoReflect() protoreflect.Message

func (*EdgeResp) Reset

func (x *EdgeResp) Reset()

func (*EdgeResp) String

func (x *EdgeResp) String() string

type EdgesReq

type EdgesReq struct {
	SourceUid  string            `protobuf:"bytes,1,opt,name=source_uid,json=sourceUid,proto3" json:"source_uid,omitempty"`
	Label      []string          `protobuf:"bytes,2,rep,name=label,proto3" json:"label,omitempty"`
	TargetUid  string            `protobuf:"bytes,3,opt,name=target_uid,json=targetUid,proto3" json:"target_uid,omitempty"`
	Properties map[string][]byte `` /* 161-byte string literal not displayed */
	// contains filtered or unexported fields
}

EdgesReq used for returning all the edges in the graph. Omitting the label or properties will return everything. Use Label to filter for nodes matching a label. Use Properties to filter for nodes containing a property.

func (*EdgesReq) Descriptor deprecated

func (*EdgesReq) Descriptor() ([]byte, []int)

Deprecated: Use EdgesReq.ProtoReflect.Descriptor instead.

func (*EdgesReq) GetLabel

func (x *EdgesReq) GetLabel() []string

func (*EdgesReq) GetProperties

func (x *EdgesReq) GetProperties() map[string][]byte

func (*EdgesReq) GetSourceUid

func (x *EdgesReq) GetSourceUid() string

func (*EdgesReq) GetTargetUid

func (x *EdgesReq) GetTargetUid() string

func (*EdgesReq) ProtoMessage

func (*EdgesReq) ProtoMessage()

func (*EdgesReq) ProtoReflect

func (x *EdgesReq) ProtoReflect() protoreflect.Message

func (*EdgesReq) Reset

func (x *EdgesReq) Reset()

func (*EdgesReq) String

func (x *EdgesReq) String() string

type GraphHandler

type GraphHandler interface {
	// AddNode adds a node to the graph.
	AddNode(context.Context, *NodeReq, *NodeResp) error
	// RemoveNode remove a node from the graph.
	RemoveNode(context.Context, *UIDReq, *RemoveResp) error
	// Node returns the node if found.
	Node(context.Context, *NodeReq, *NodeResp) error
	// Nodes returns all the node in the graph.
	Nodes(context.Context, *NodesReq, Graph_NodesStream) error
	// AddEdge adds a edge to the graph.
	AddEdge(context.Context, *EdgeReq, *EdgeResp) error
	// RemoveEdge remove a edge from the graph.
	RemoveEdge(context.Context, *UIDReq, *RemoveResp) error
	// Edge returns the edge if found.
	Edge(context.Context, *EdgeReq, *EdgeResp) error
	// Edges returns all the edges in the graph.
	Edges(context.Context, *EdgesReq, Graph_EdgesStream) error
	// Stats returns some stats about the service.
	Stats(context.Context, *StatsReq, *StatsResp) error
	// Query sends a query to the graph and returns a dump
	// with the query results.
	Query(context.Context, *QueryReq, *DumpResp) error
	// Dump the graph.
	Dump(context.Context, *DumpReq, *DumpResp) error
}

type GraphService

type GraphService interface {
	// AddNode adds a node to the graph.
	AddNode(ctx context.Context, in *NodeReq, opts ...client.CallOption) (*NodeResp, error)
	// RemoveNode remove a node from the graph.
	RemoveNode(ctx context.Context, in *UIDReq, opts ...client.CallOption) (*RemoveResp, error)
	// Node returns the node if found.
	Node(ctx context.Context, in *NodeReq, opts ...client.CallOption) (*NodeResp, error)
	// Nodes returns all the node in the graph.
	Nodes(ctx context.Context, in *NodesReq, opts ...client.CallOption) (Graph_NodesService, error)
	// AddEdge adds a edge to the graph.
	AddEdge(ctx context.Context, in *EdgeReq, opts ...client.CallOption) (*EdgeResp, error)
	// RemoveEdge remove a edge from the graph.
	RemoveEdge(ctx context.Context, in *UIDReq, opts ...client.CallOption) (*RemoveResp, error)
	// Edge returns the edge if found.
	Edge(ctx context.Context, in *EdgeReq, opts ...client.CallOption) (*EdgeResp, error)
	// Edges returns all the edges in the graph.
	Edges(ctx context.Context, in *EdgesReq, opts ...client.CallOption) (Graph_EdgesService, error)
	// Stats returns some stats about the service.
	Stats(ctx context.Context, in *StatsReq, opts ...client.CallOption) (*StatsResp, error)
	// Query sends a query to the graph and returns a dump
	// with the query results.
	Query(ctx context.Context, in *QueryReq, opts ...client.CallOption) (*DumpResp, error)
	// Dump the graph.
	Dump(ctx context.Context, in *DumpReq, opts ...client.CallOption) (*DumpResp, error)
}

func NewGraphService

func NewGraphService(name string, c client.Client) GraphService

type Graph_EdgesService

type Graph_EdgesService interface {
	Context() context.Context
	SendMsg(interface{}) error
	RecvMsg(interface{}) error
	Close() error
	Recv() (*EdgeResp, error)
}

type Graph_EdgesStream

type Graph_EdgesStream interface {
	Context() context.Context
	SendMsg(interface{}) error
	RecvMsg(interface{}) error
	Close() error
	Send(*EdgeResp) error
}

type Graph_NodesService

type Graph_NodesService interface {
	Context() context.Context
	SendMsg(interface{}) error
	RecvMsg(interface{}) error
	Close() error
	Recv() (*NodeResp, error)
}

type Graph_NodesStream

type Graph_NodesStream interface {
	Context() context.Context
	SendMsg(interface{}) error
	RecvMsg(interface{}) error
	Close() error
	Send(*NodeResp) error
}

type NodeReq

type NodeReq struct {
	Uid        string            `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	Label      string            `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
	Properties map[string][]byte `` /* 161-byte string literal not displayed */
	// contains filtered or unexported fields
}

NodeReq is a node request.

func (*NodeReq) Descriptor deprecated

func (*NodeReq) Descriptor() ([]byte, []int)

Deprecated: Use NodeReq.ProtoReflect.Descriptor instead.

func (*NodeReq) GetLabel

func (x *NodeReq) GetLabel() string

func (*NodeReq) GetProperties

func (x *NodeReq) GetProperties() map[string][]byte

func (*NodeReq) GetUid

func (x *NodeReq) GetUid() string

func (*NodeReq) ProtoMessage

func (*NodeReq) ProtoMessage()

func (*NodeReq) ProtoReflect

func (x *NodeReq) ProtoReflect() protoreflect.Message

func (*NodeReq) Reset

func (x *NodeReq) Reset()

func (*NodeReq) String

func (x *NodeReq) String() string

type NodeResp

type NodeResp struct {
	Uid        string            `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	Label      string            `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
	Properties map[string][]byte `` /* 161-byte string literal not displayed */
	InEdges    []string          `protobuf:"bytes,4,rep,name=in_edges,json=inEdges,proto3" json:"in_edges,omitempty"`
	OutEdges   []string          `protobuf:"bytes,5,rep,name=out_edges,json=outEdges,proto3" json:"out_edges,omitempty"`
	// contains filtered or unexported fields
}

NodeResp is a node response.

func (*NodeResp) Descriptor deprecated

func (*NodeResp) Descriptor() ([]byte, []int)

Deprecated: Use NodeResp.ProtoReflect.Descriptor instead.

func (*NodeResp) GetInEdges

func (x *NodeResp) GetInEdges() []string

func (*NodeResp) GetLabel

func (x *NodeResp) GetLabel() string

func (*NodeResp) GetOutEdges

func (x *NodeResp) GetOutEdges() []string

func (*NodeResp) GetProperties

func (x *NodeResp) GetProperties() map[string][]byte

func (*NodeResp) GetUid

func (x *NodeResp) GetUid() string

func (*NodeResp) ProtoMessage

func (*NodeResp) ProtoMessage()

func (*NodeResp) ProtoReflect

func (x *NodeResp) ProtoReflect() protoreflect.Message

func (*NodeResp) Reset

func (x *NodeResp) Reset()

func (*NodeResp) String

func (x *NodeResp) String() string

type NodesReq

type NodesReq struct {
	Label      []string          `protobuf:"bytes,1,rep,name=label,proto3" json:"label,omitempty"`
	Properties map[string][]byte `` /* 161-byte string literal not displayed */
	// contains filtered or unexported fields
}

NodesReq used for returning all the nodes in the graph. Omitting the label or properties will return everything. Use Label to filter for nodes matching a label. Use Properties to filter for nodes containing a property.

func (*NodesReq) Descriptor deprecated

func (*NodesReq) Descriptor() ([]byte, []int)

Deprecated: Use NodesReq.ProtoReflect.Descriptor instead.

func (*NodesReq) GetLabel

func (x *NodesReq) GetLabel() []string

func (*NodesReq) GetProperties

func (x *NodesReq) GetProperties() map[string][]byte

func (*NodesReq) ProtoMessage

func (*NodesReq) ProtoMessage()

func (*NodesReq) ProtoReflect

func (x *NodesReq) ProtoReflect() protoreflect.Message

func (*NodesReq) Reset

func (x *NodesReq) Reset()

func (*NodesReq) String

func (x *NodesReq) String() string

type QueryReq

type QueryReq struct {
	Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
	// contains filtered or unexported fields
}

QueryReq is query request.

func (*QueryReq) Descriptor deprecated

func (*QueryReq) Descriptor() ([]byte, []int)

Deprecated: Use QueryReq.ProtoReflect.Descriptor instead.

func (*QueryReq) GetQuery

func (x *QueryReq) GetQuery() string

func (*QueryReq) ProtoMessage

func (*QueryReq) ProtoMessage()

func (*QueryReq) ProtoReflect

func (x *QueryReq) ProtoReflect() protoreflect.Message

func (*QueryReq) Reset

func (x *QueryReq) Reset()

func (*QueryReq) String

func (x *QueryReq) String() string

type RemoveResp

type RemoveResp struct {
	Uid     string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	Error   string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	Success bool   `protobuf:"varint,3,opt,name=success,proto3" json:"success,omitempty"`
	// contains filtered or unexported fields
}

RemoveResp is a response when removing a item from the graph.

func (*RemoveResp) Descriptor deprecated

func (*RemoveResp) Descriptor() ([]byte, []int)

Deprecated: Use RemoveResp.ProtoReflect.Descriptor instead.

func (*RemoveResp) GetError

func (x *RemoveResp) GetError() string

func (*RemoveResp) GetSuccess

func (x *RemoveResp) GetSuccess() bool

func (*RemoveResp) GetUid

func (x *RemoveResp) GetUid() string

func (*RemoveResp) ProtoMessage

func (*RemoveResp) ProtoMessage()

func (*RemoveResp) ProtoReflect

func (x *RemoveResp) ProtoReflect() protoreflect.Message

func (*RemoveResp) Reset

func (x *RemoveResp) Reset()

func (*RemoveResp) String

func (x *RemoveResp) String() string

type StatsReq

type StatsReq struct {
	// contains filtered or unexported fields
}

StatsReq is a stats message containing inforamtion about the service.

func (*StatsReq) Descriptor deprecated

func (*StatsReq) Descriptor() ([]byte, []int)

Deprecated: Use StatsReq.ProtoReflect.Descriptor instead.

func (*StatsReq) ProtoMessage

func (*StatsReq) ProtoMessage()

func (*StatsReq) ProtoReflect

func (x *StatsReq) ProtoReflect() protoreflect.Message

func (*StatsReq) Reset

func (x *StatsReq) Reset()

func (*StatsReq) String

func (x *StatsReq) String() string

type StatsResp

type StatsResp struct {

	// start time in UTC when the instance started.
	StartTime string `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	// number of CPUS available.
	NumCpu int32 `protobuf:"varint,2,opt,name=num_cpu,json=numCpu,proto3" json:"num_cpu,omitempty"`
	// number of goroutings running.
	NumGoroutines int32 `protobuf:"varint,3,opt,name=num_goroutines,json=numGoroutines,proto3" json:"num_goroutines,omitempty"`
	// number of nodes in the graph.
	NodeCount int32 `protobuf:"varint,4,opt,name=node_count,json=nodeCount,proto3" json:"node_count,omitempty"`
	// number of edges in the graph.
	EdgeCount int32 `protobuf:"varint,5,opt,name=edge_count,json=edgeCount,proto3" json:"edge_count,omitempty"`
	// total memory allocated in bytes.
	TotalMemoryAlloc int32 `protobuf:"varint,6,opt,name=total_memory_alloc,json=totalMemoryAlloc,proto3" json:"total_memory_alloc,omitempty"`
	// contains filtered or unexported fields
}

StatsResp is the stats response with information about the service.

func (*StatsResp) Descriptor deprecated

func (*StatsResp) Descriptor() ([]byte, []int)

Deprecated: Use StatsResp.ProtoReflect.Descriptor instead.

func (*StatsResp) GetEdgeCount

func (x *StatsResp) GetEdgeCount() int32

func (*StatsResp) GetNodeCount

func (x *StatsResp) GetNodeCount() int32

func (*StatsResp) GetNumCpu

func (x *StatsResp) GetNumCpu() int32

func (*StatsResp) GetNumGoroutines

func (x *StatsResp) GetNumGoroutines() int32

func (*StatsResp) GetStartTime

func (x *StatsResp) GetStartTime() string

func (*StatsResp) GetTotalMemoryAlloc

func (x *StatsResp) GetTotalMemoryAlloc() int32

func (*StatsResp) ProtoMessage

func (*StatsResp) ProtoMessage()

func (*StatsResp) ProtoReflect

func (x *StatsResp) ProtoReflect() protoreflect.Message

func (*StatsResp) Reset

func (x *StatsResp) Reset()

func (*StatsResp) String

func (x *StatsResp) String() string

type UIDReq

type UIDReq struct {
	Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	// contains filtered or unexported fields
}

UIDReq is a request used for searching the graph for a node/edge which contains the uid.

func (*UIDReq) Descriptor deprecated

func (*UIDReq) Descriptor() ([]byte, []int)

Deprecated: Use UIDReq.ProtoReflect.Descriptor instead.

func (*UIDReq) GetUid

func (x *UIDReq) GetUid() string

func (*UIDReq) ProtoMessage

func (*UIDReq) ProtoMessage()

func (*UIDReq) ProtoReflect

func (x *UIDReq) ProtoReflect() protoreflect.Message

func (*UIDReq) Reset

func (x *UIDReq) Reset()

func (*UIDReq) String

func (x *UIDReq) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL