graphstore

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2021 License: MIT Imports: 17 Imported by: 1

Documentation

Overview

Package graphstore is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_graphstore_api_v1beta_graphstore_proto protoreflect.FileDescriptor
View Source
var GraphStore_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "graphstore.api.v1beta.GraphStore",
	HandlerType: (*GraphStoreServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Put",
			Handler:    _GraphStore_Put_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _GraphStore_Delete_Handler,
		},
		{
			MethodName: "List",
			Handler:    _GraphStore_List_Handler,
		},
		{
			MethodName: "Neighbors",
			Handler:    _GraphStore_Neighbors_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Traverse",
			Handler:       _GraphStore_Traverse_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "graphstore/api/v1beta/graphstore.proto",
}

GraphStore_ServiceDesc is the grpc.ServiceDesc for GraphStore service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterGraphStoreHandler

func RegisterGraphStoreHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterGraphStoreHandler registers the http handlers for service GraphStore to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterGraphStoreHandlerClient

func RegisterGraphStoreHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GraphStoreClient) error

RegisterGraphStoreHandlerClient registers the http handlers for service GraphStore to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "GraphStoreClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "GraphStoreClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "GraphStoreClient" to call the correct interceptors.

func RegisterGraphStoreHandlerFromEndpoint

func RegisterGraphStoreHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterGraphStoreHandlerFromEndpoint is same as RegisterGraphStoreHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterGraphStoreHandlerServer

func RegisterGraphStoreHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GraphStoreServer) error

RegisterGraphStoreHandlerServer registers the http handlers for service GraphStore to "mux". UnaryRPC :call GraphStoreServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterGraphStoreHandlerFromEndpoint instead.

func RegisterGraphStoreServer

func RegisterGraphStoreServer(s grpc.ServiceRegistrar, srv GraphStoreServer)

Types

type DeleteRequest

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

DeleteRequest encapsulates elements we are removing from the database.

func (*DeleteRequest) Descriptor deprecated

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

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetEdges

func (x *DeleteRequest) GetEdges() []*Edge

func (*DeleteRequest) GetNodes

func (x *DeleteRequest) GetNodes() []*Node

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect added in v0.3.2

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

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

type DeleteResponse

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

func (*DeleteResponse) Descriptor deprecated

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

Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) ProtoReflect added in v0.3.2

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

func (*DeleteResponse) Reset

func (x *DeleteResponse) Reset()

func (*DeleteResponse) String

func (x *DeleteResponse) String() string

type Edge

type Edge struct {
	FromKey []byte   `protobuf:"bytes,1,opt,name=from_key,json=fromKey,proto3" json:"from_key,omitempty"`
	ToKey   []byte   `protobuf:"bytes,2,opt,name=to_key,json=toKey,proto3" json:"to_key,omitempty"`
	Key     []byte   `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` // optional
	Body    *any.Any `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

Edges represent associations between nodes.

func (*Edge) Descriptor deprecated

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

Deprecated: Use Edge.ProtoReflect.Descriptor instead.

func (*Edge) GetBody

func (x *Edge) GetBody() *any.Any

func (*Edge) GetFromKey

func (x *Edge) GetFromKey() []byte

func (*Edge) GetKey

func (x *Edge) GetKey() []byte

func (*Edge) GetToKey

func (x *Edge) GetToKey() []byte

func (*Edge) ProtoMessage

func (*Edge) ProtoMessage()

func (*Edge) ProtoReflect added in v0.3.2

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

func (*Edge) Reset

func (x *Edge) Reset()

func (*Edge) String

func (x *Edge) String() string

type EdgeFilter

type EdgeFilter struct {
	Body *any.Any `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

EdgeFilter is used to reduce the considered edges

func (*EdgeFilter) Descriptor deprecated

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

Deprecated: Use EdgeFilter.ProtoReflect.Descriptor instead.

func (*EdgeFilter) GetBody

func (x *EdgeFilter) GetBody() *any.Any

func (*EdgeFilter) ProtoMessage

func (*EdgeFilter) ProtoMessage()

func (*EdgeFilter) ProtoReflect added in v0.3.2

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

func (*EdgeFilter) Reset

func (x *EdgeFilter) Reset()

func (*EdgeFilter) String

func (x *EdgeFilter) String() string

type GraphStoreClient

type GraphStoreClient interface {
	// Used to insert data into the store.
	Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error)
	// Used to delete data from the store.
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
	// Used to list data within the store.
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
	// Used to query data within the store.
	Neighbors(ctx context.Context, in *NeighborsRequest, opts ...grpc.CallOption) (*NeighborsResponse, error)
	// Used to navigate the graph.
	Traverse(ctx context.Context, opts ...grpc.CallOption) (GraphStore_TraverseClient, error)
}

GraphStoreClient is the client API for GraphStore service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewGraphStoreClient

func NewGraphStoreClient(cc grpc.ClientConnInterface) GraphStoreClient

type GraphStoreServer

type GraphStoreServer interface {
	// Used to insert data into the store.
	Put(context.Context, *PutRequest) (*PutResponse, error)
	// Used to delete data from the store.
	Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
	// Used to list data within the store.
	List(context.Context, *ListRequest) (*ListResponse, error)
	// Used to query data within the store.
	Neighbors(context.Context, *NeighborsRequest) (*NeighborsResponse, error)
	// Used to navigate the graph.
	Traverse(GraphStore_TraverseServer) error
	// contains filtered or unexported methods
}

GraphStoreServer is the server API for GraphStore service. All implementations must embed UnimplementedGraphStoreServer for forward compatibility

type GraphStore_TraverseClient

type GraphStore_TraverseClient interface {
	Send(*TraverseRequest) error
	Recv() (*TraverseResponse, error)
	grpc.ClientStream
}

type GraphStore_TraverseServer

type GraphStore_TraverseServer interface {
	Send(*TraverseResponse) error
	Recv() (*TraverseRequest, error)
	grpc.ServerStream
}

type ListRequest

type ListRequest struct {
	Parent    string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
	PageSize  int32  `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	Kind      string `protobuf:"bytes,4,opt,name=kind,proto3" json:"kind,omitempty"`
	// contains filtered or unexported fields
}

ListRequest encapsulates requirements for listing data from the database.

func (*ListRequest) Descriptor deprecated

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

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetKind

func (x *ListRequest) GetKind() string

func (*ListRequest) GetPageSize

func (x *ListRequest) GetPageSize() int32

func (*ListRequest) GetPageToken

func (x *ListRequest) GetPageToken() string

func (*ListRequest) GetParent

func (x *ListRequest) GetParent() string

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect added in v0.3.2

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

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

type ListResponse

type ListResponse struct {
	NextPageToken string  `protobuf:"bytes,1,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
	Nodes         []*Node `protobuf:"bytes,2,rep,name=nodes,proto3" json:"nodes,omitempty"`
	Edges         []*Edge `protobuf:"bytes,3,rep,name=edges,proto3" json:"edges,omitempty"`
	// contains filtered or unexported fields
}

ListResponse encapsulates listed response data.

func (*ListResponse) Descriptor deprecated

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

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetEdges

func (x *ListResponse) GetEdges() []*Edge

func (*ListResponse) GetNextPageToken

func (x *ListResponse) GetNextPageToken() string

func (*ListResponse) GetNodes

func (x *ListResponse) GetNodes() []*Node

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect added in v0.3.2

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

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) String() string

type Neighbor

type Neighbor struct {
	Node  *Node   `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
	Edges []*Edge `protobuf:"bytes,2,rep,name=edges,proto3" json:"edges,omitempty"`
	// contains filtered or unexported fields
}

Neighbor represents a node and all the edges pointing to it.

func (*Neighbor) Descriptor deprecated

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

Deprecated: Use Neighbor.ProtoReflect.Descriptor instead.

func (*Neighbor) GetEdges

func (x *Neighbor) GetEdges() []*Edge

func (*Neighbor) GetNode

func (x *Neighbor) GetNode() *Node

func (*Neighbor) ProtoMessage

func (*Neighbor) ProtoMessage()

func (*Neighbor) ProtoReflect added in v0.3.2

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

func (*Neighbor) Reset

func (x *Neighbor) Reset()

func (*Neighbor) String

func (x *Neighbor) String() string

type NeighborsRequest

type NeighborsRequest struct {

	// Used to fetch all neighbors of a node, regardless of directionality.
	Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
	// Used to fetch all neighbors on the receiving end of edges.
	From *Node `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"`
	// Used to fetch all neighbors on the initiating end of edges.
	To *Node `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"`
	// Used to reduce the edges considered when finding neighbors.
	Filter []*EdgeFilter `protobuf:"bytes,4,rep,name=filter,proto3" json:"filter,omitempty"`
	// contains filtered or unexported fields
}

NeighborsRequest encapsulates the variety of ways neighbors can be looked up.

func (*NeighborsRequest) Descriptor deprecated

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

Deprecated: Use NeighborsRequest.ProtoReflect.Descriptor instead.

func (*NeighborsRequest) GetFilter

func (x *NeighborsRequest) GetFilter() []*EdgeFilter

func (*NeighborsRequest) GetFrom

func (x *NeighborsRequest) GetFrom() *Node

func (*NeighborsRequest) GetNode

func (x *NeighborsRequest) GetNode() *Node

func (*NeighborsRequest) GetTo

func (x *NeighborsRequest) GetTo() *Node

func (*NeighborsRequest) ProtoMessage

func (*NeighborsRequest) ProtoMessage()

func (*NeighborsRequest) ProtoReflect added in v0.3.2

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

func (*NeighborsRequest) Reset

func (x *NeighborsRequest) Reset()

func (*NeighborsRequest) String

func (x *NeighborsRequest) String() string

type NeighborsResponse

type NeighborsResponse struct {
	Neighbors []*Neighbor `protobuf:"bytes,1,rep,name=neighbors,proto3" json:"neighbors,omitempty"`
	// contains filtered or unexported fields
}

NeighborsResponse returns all neighbors from the query.

func (*NeighborsResponse) Descriptor deprecated

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

Deprecated: Use NeighborsResponse.ProtoReflect.Descriptor instead.

func (*NeighborsResponse) GetNeighbors

func (x *NeighborsResponse) GetNeighbors() []*Neighbor

func (*NeighborsResponse) ProtoMessage

func (*NeighborsResponse) ProtoMessage()

func (*NeighborsResponse) ProtoReflect added in v0.3.2

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

func (*NeighborsResponse) Reset

func (x *NeighborsResponse) Reset()

func (*NeighborsResponse) String

func (x *NeighborsResponse) String() string

type Node

type Node struct {
	Key  []byte   `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Body *any.Any `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

Nodes represent entities in a graph.

func (*Node) Descriptor deprecated

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

Deprecated: Use Node.ProtoReflect.Descriptor instead.

func (*Node) GetBody

func (x *Node) GetBody() *any.Any

func (*Node) GetKey

func (x *Node) GetKey() []byte

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) ProtoReflect added in v0.3.2

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

func (*Node) Reset

func (x *Node) Reset()

func (*Node) String

func (x *Node) String() string

type PutRequest

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

PutRequest encapsulates elements we are inserting into the database.

func (*PutRequest) Descriptor deprecated

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

Deprecated: Use PutRequest.ProtoReflect.Descriptor instead.

func (*PutRequest) GetEdges

func (x *PutRequest) GetEdges() []*Edge

func (*PutRequest) GetNodes

func (x *PutRequest) GetNodes() []*Node

func (*PutRequest) ProtoMessage

func (*PutRequest) ProtoMessage()

func (*PutRequest) ProtoReflect added in v0.3.2

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

func (*PutRequest) Reset

func (x *PutRequest) Reset()

func (*PutRequest) String

func (x *PutRequest) String() string

type PutResponse

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

func (*PutResponse) Descriptor deprecated

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

Deprecated: Use PutResponse.ProtoReflect.Descriptor instead.

func (*PutResponse) ProtoMessage

func (*PutResponse) ProtoMessage()

func (*PutResponse) ProtoReflect added in v0.3.2

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

func (*PutResponse) Reset

func (x *PutResponse) Reset()

func (*PutResponse) String

func (x *PutResponse) String() string

type TraverseRequest

type TraverseRequest struct {
	Cancel  bool              `protobuf:"varint,1,opt,name=cancel,proto3" json:"cancel,omitempty"`
	Request *NeighborsRequest `protobuf:"bytes,2,opt,name=request,proto3" json:"request,omitempty"`
	// contains filtered or unexported fields
}

TraverseRequest is used to navigate the graph, optionally halting once the desired node is found.

func (*TraverseRequest) Descriptor deprecated

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

Deprecated: Use TraverseRequest.ProtoReflect.Descriptor instead.

func (*TraverseRequest) GetCancel

func (x *TraverseRequest) GetCancel() bool

func (*TraverseRequest) GetRequest

func (x *TraverseRequest) GetRequest() *NeighborsRequest

func (*TraverseRequest) ProtoMessage

func (*TraverseRequest) ProtoMessage()

func (*TraverseRequest) ProtoReflect added in v0.3.2

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

func (*TraverseRequest) Reset

func (x *TraverseRequest) Reset()

func (*TraverseRequest) String

func (x *TraverseRequest) String() string

type TraverseResponse

type TraverseResponse struct {
	Request  *NeighborsRequest  `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"`
	Response *NeighborsResponse `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"`
	// contains filtered or unexported fields
}

TraverseResponse is used to encapsulate a traversal request and its associated response data.

func (*TraverseResponse) Descriptor deprecated

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

Deprecated: Use TraverseResponse.ProtoReflect.Descriptor instead.

func (*TraverseResponse) GetRequest

func (x *TraverseResponse) GetRequest() *NeighborsRequest

func (*TraverseResponse) GetResponse

func (x *TraverseResponse) GetResponse() *NeighborsResponse

func (*TraverseResponse) ProtoMessage

func (*TraverseResponse) ProtoMessage()

func (*TraverseResponse) ProtoReflect added in v0.3.2

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

func (*TraverseResponse) Reset

func (x *TraverseResponse) Reset()

func (*TraverseResponse) String

func (x *TraverseResponse) String() string

type UnimplementedGraphStoreServer

type UnimplementedGraphStoreServer struct {
}

UnimplementedGraphStoreServer must be embedded to have forward compatible implementations.

func (UnimplementedGraphStoreServer) Delete

func (UnimplementedGraphStoreServer) List

func (UnimplementedGraphStoreServer) Neighbors

func (UnimplementedGraphStoreServer) Put

func (UnimplementedGraphStoreServer) Traverse

type UnsafeGraphStoreServer added in v0.3.2

type UnsafeGraphStoreServer interface {
	// contains filtered or unexported methods
}

UnsafeGraphStoreServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GraphStoreServer will result in compilation errors.

Jump to

Keyboard shortcuts

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