Documentation ¶
Overview ¶
Package rpc defines an RPC server managing a blob store, and a client for it that implements bs.Store (and anchor.Store).
Index ¶
- Variables
- func RegisterStoreServer(s *grpc.Server, srv StoreServer)
- type AnchorMapRefRequest
- type AnchorMapRefResponse
- func (*AnchorMapRefResponse) Descriptor() ([]byte, []int)deprecated
- func (x *AnchorMapRefResponse) GetRef() []byte
- func (*AnchorMapRefResponse) ProtoMessage()
- func (x *AnchorMapRefResponse) ProtoReflect() protoreflect.Message
- func (x *AnchorMapRefResponse) Reset()
- func (x *AnchorMapRefResponse) String() string
- type Client
- func (c *Client) AnchorMapRef(ctx context.Context) (bs.Ref, error)
- func (c *Client) Get(ctx context.Context, ref bs.Ref) (bs.Blob, error)
- func (c *Client) ListRefs(ctx context.Context, start bs.Ref, f func(bs.Ref) error) error
- func (c *Client) Put(ctx context.Context, blob bs.Blob) (bs.Ref, bool, error)
- func (c *Client) UpdateAnchorMap(ctx context.Context, f anchor.UpdateFunc) error
- type GetRequest
- type GetResponse
- type ListRefsRequest
- type ListRefsResponse
- type PutRequest
- type PutResponse
- type Server
- func (s *Server) AnchorMapRef(ctx context.Context, req *AnchorMapRefRequest) (*AnchorMapRefResponse, error)
- func (s *Server) Get(ctx context.Context, req *GetRequest) (*GetResponse, error)
- func (s *Server) ListRefs(req *ListRefsRequest, srv Store_ListRefsServer) error
- func (s *Server) Put(ctx context.Context, req *PutRequest) (*PutResponse, error)
- func (s *Server) UpdateAnchorMap(ctx context.Context, req *UpdateAnchorMapRequest) (*UpdateAnchorMapResponse, error)
- type StoreClient
- type StoreServer
- type Store_ListRefsClient
- type Store_ListRefsServer
- type UnimplementedStoreServer
- func (*UnimplementedStoreServer) AnchorMapRef(context.Context, *AnchorMapRefRequest) (*AnchorMapRefResponse, error)
- func (*UnimplementedStoreServer) Get(context.Context, *GetRequest) (*GetResponse, error)
- func (*UnimplementedStoreServer) ListRefs(*ListRefsRequest, Store_ListRefsServer) error
- func (*UnimplementedStoreServer) Put(context.Context, *PutRequest) (*PutResponse, error)
- func (*UnimplementedStoreServer) UpdateAnchorMap(context.Context, *UpdateAnchorMapRequest) (*UpdateAnchorMapResponse, error)
- type UpdateAnchorMapRequest
- func (*UpdateAnchorMapRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateAnchorMapRequest) GetNewRef() []byte
- func (x *UpdateAnchorMapRequest) GetOldRef() []byte
- func (*UpdateAnchorMapRequest) ProtoMessage()
- func (x *UpdateAnchorMapRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateAnchorMapRequest) Reset()
- func (x *UpdateAnchorMapRequest) String() string
- type UpdateAnchorMapResponse
Constants ¶
This section is empty.
Variables ¶
var File_rpc_proto protoreflect.FileDescriptor
Functions ¶
func RegisterStoreServer ¶
func RegisterStoreServer(s *grpc.Server, srv StoreServer)
Types ¶
type AnchorMapRefRequest ¶
type AnchorMapRefRequest struct {
// contains filtered or unexported fields
}
func (*AnchorMapRefRequest) Descriptor
deprecated
func (*AnchorMapRefRequest) Descriptor() ([]byte, []int)
Deprecated: Use AnchorMapRefRequest.ProtoReflect.Descriptor instead.
func (*AnchorMapRefRequest) ProtoMessage ¶
func (*AnchorMapRefRequest) ProtoMessage()
func (*AnchorMapRefRequest) ProtoReflect ¶
func (x *AnchorMapRefRequest) ProtoReflect() protoreflect.Message
func (*AnchorMapRefRequest) Reset ¶
func (x *AnchorMapRefRequest) Reset()
func (*AnchorMapRefRequest) String ¶
func (x *AnchorMapRefRequest) String() string
type AnchorMapRefResponse ¶
type AnchorMapRefResponse struct { Ref []byte `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"` // contains filtered or unexported fields }
func (*AnchorMapRefResponse) Descriptor
deprecated
func (*AnchorMapRefResponse) Descriptor() ([]byte, []int)
Deprecated: Use AnchorMapRefResponse.ProtoReflect.Descriptor instead.
func (*AnchorMapRefResponse) GetRef ¶
func (x *AnchorMapRefResponse) GetRef() []byte
func (*AnchorMapRefResponse) ProtoMessage ¶
func (*AnchorMapRefResponse) ProtoMessage()
func (*AnchorMapRefResponse) ProtoReflect ¶
func (x *AnchorMapRefResponse) ProtoReflect() protoreflect.Message
func (*AnchorMapRefResponse) Reset ¶
func (x *AnchorMapRefResponse) Reset()
func (*AnchorMapRefResponse) String ¶
func (x *AnchorMapRefResponse) String() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the type of a client for Server. It implements anchor.Store.
func NewClient ¶
func NewClient(cc grpc.ClientConnInterface) *Client
NewClient produces a new Client capable of communicating with a Server. The ClientConnInterface specifies the necessary communication channel and can be obtained by calling gprc.Dial or grpc.DialContext (qv).
func (*Client) AnchorMapRef ¶
AnchorMapRef implements anchor.Getter.
func (*Client) UpdateAnchorMap ¶
UpdateAnchorMap implements anchor.Store.
type GetRequest ¶
type GetRequest struct { Ref []byte `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"` // contains filtered or unexported fields }
func (*GetRequest) Descriptor
deprecated
func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) GetRef ¶
func (x *GetRequest) GetRef() []byte
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) ProtoReflect ¶
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶
func (x *GetRequest) Reset()
func (*GetRequest) String ¶
func (x *GetRequest) String() string
type GetResponse ¶
type GetResponse struct { Blob []byte `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"` // contains filtered or unexported fields }
func (*GetResponse) Descriptor
deprecated
func (*GetResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.
func (*GetResponse) GetBlob ¶
func (x *GetResponse) GetBlob() []byte
func (*GetResponse) ProtoMessage ¶
func (*GetResponse) ProtoMessage()
func (*GetResponse) ProtoReflect ¶
func (x *GetResponse) ProtoReflect() protoreflect.Message
func (*GetResponse) Reset ¶
func (x *GetResponse) Reset()
func (*GetResponse) String ¶
func (x *GetResponse) String() string
type ListRefsRequest ¶
type ListRefsRequest struct { Start []byte `protobuf:"bytes,1,opt,name=start,proto3" json:"start,omitempty"` // contains filtered or unexported fields }
func (*ListRefsRequest) Descriptor
deprecated
func (*ListRefsRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListRefsRequest.ProtoReflect.Descriptor instead.
func (*ListRefsRequest) GetStart ¶
func (x *ListRefsRequest) GetStart() []byte
func (*ListRefsRequest) ProtoMessage ¶
func (*ListRefsRequest) ProtoMessage()
func (*ListRefsRequest) ProtoReflect ¶
func (x *ListRefsRequest) ProtoReflect() protoreflect.Message
func (*ListRefsRequest) Reset ¶
func (x *ListRefsRequest) Reset()
func (*ListRefsRequest) String ¶
func (x *ListRefsRequest) String() string
type ListRefsResponse ¶
type ListRefsResponse struct { Ref []byte `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"` // contains filtered or unexported fields }
func (*ListRefsResponse) Descriptor
deprecated
func (*ListRefsResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListRefsResponse.ProtoReflect.Descriptor instead.
func (*ListRefsResponse) GetRef ¶
func (x *ListRefsResponse) GetRef() []byte
func (*ListRefsResponse) ProtoMessage ¶
func (*ListRefsResponse) ProtoMessage()
func (*ListRefsResponse) ProtoReflect ¶
func (x *ListRefsResponse) ProtoReflect() protoreflect.Message
func (*ListRefsResponse) Reset ¶
func (x *ListRefsResponse) Reset()
func (*ListRefsResponse) String ¶
func (x *ListRefsResponse) String() string
type PutRequest ¶
type PutRequest struct { Blob []byte `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"` // contains filtered or unexported fields }
func (*PutRequest) Descriptor
deprecated
func (*PutRequest) Descriptor() ([]byte, []int)
Deprecated: Use PutRequest.ProtoReflect.Descriptor instead.
func (*PutRequest) GetBlob ¶
func (x *PutRequest) GetBlob() []byte
func (*PutRequest) ProtoMessage ¶
func (*PutRequest) ProtoMessage()
func (*PutRequest) ProtoReflect ¶
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 { Ref []byte `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"` Added bool `protobuf:"varint,2,opt,name=added,proto3" json:"added,omitempty"` // contains filtered or unexported fields }
func (*PutResponse) Descriptor
deprecated
func (*PutResponse) Descriptor() ([]byte, []int)
Deprecated: Use PutResponse.ProtoReflect.Descriptor instead.
func (*PutResponse) GetAdded ¶
func (x *PutResponse) GetAdded() bool
func (*PutResponse) GetRef ¶
func (x *PutResponse) GetRef() []byte
func (*PutResponse) ProtoMessage ¶
func (*PutResponse) ProtoMessage()
func (*PutResponse) ProtoReflect ¶
func (x *PutResponse) ProtoReflect() protoreflect.Message
func (*PutResponse) Reset ¶
func (x *PutResponse) Reset()
func (*PutResponse) String ¶
func (x *PutResponse) String() string
type Server ¶
type Server struct { UnimplementedStoreServer // "All implementations must embed UnimplementedStoreServer for forward compatibility." // contains filtered or unexported fields }
Server is the type of an RPC server that is an interface to a bs.Store. Use Client to communicate with a Server (qv).
func NewServer ¶
NewServer produces a new Server interacting with a given bs.Store. The given store may optionally be an anchor.Store as well.
func (*Server) AnchorMapRef ¶
func (s *Server) AnchorMapRef(ctx context.Context, req *AnchorMapRefRequest) (*AnchorMapRefResponse, error)
AnchorMapRef implements StoreServer.AnchorMapRef.
func (*Server) Get ¶
func (s *Server) Get(ctx context.Context, req *GetRequest) (*GetResponse, error)
Get implements StoreServer.Get.
func (*Server) ListRefs ¶
func (s *Server) ListRefs(req *ListRefsRequest, srv Store_ListRefsServer) error
ListRefs implements StoreServer.ListRefs.
func (*Server) Put ¶
func (s *Server) Put(ctx context.Context, req *PutRequest) (*PutResponse, error)
Put implements StoreServer.Put.
func (*Server) UpdateAnchorMap ¶
func (s *Server) UpdateAnchorMap(ctx context.Context, req *UpdateAnchorMapRequest) (*UpdateAnchorMapResponse, error)
UpdateAnchorMap implements StoreServer.UpdateAnchorMap. TODO: revisit this implementation, something seems fishy about it.
type StoreClient ¶
type StoreClient interface { Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) ListRefs(ctx context.Context, in *ListRefsRequest, opts ...grpc.CallOption) (Store_ListRefsClient, error) AnchorMapRef(ctx context.Context, in *AnchorMapRefRequest, opts ...grpc.CallOption) (*AnchorMapRefResponse, error) UpdateAnchorMap(ctx context.Context, in *UpdateAnchorMapRequest, opts ...grpc.CallOption) (*UpdateAnchorMapResponse, error) }
StoreClient is the client API for Store 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 NewStoreClient ¶
func NewStoreClient(cc grpc.ClientConnInterface) StoreClient
type StoreServer ¶
type StoreServer interface { Get(context.Context, *GetRequest) (*GetResponse, error) Put(context.Context, *PutRequest) (*PutResponse, error) ListRefs(*ListRefsRequest, Store_ListRefsServer) error AnchorMapRef(context.Context, *AnchorMapRefRequest) (*AnchorMapRefResponse, error) UpdateAnchorMap(context.Context, *UpdateAnchorMapRequest) (*UpdateAnchorMapResponse, error) // contains filtered or unexported methods }
StoreServer is the server API for Store service. All implementations must embed UnimplementedStoreServer for forward compatibility
type Store_ListRefsClient ¶
type Store_ListRefsClient interface { Recv() (*ListRefsResponse, error) grpc.ClientStream }
type Store_ListRefsServer ¶
type Store_ListRefsServer interface { Send(*ListRefsResponse) error grpc.ServerStream }
type UnimplementedStoreServer ¶
type UnimplementedStoreServer struct { }
UnimplementedStoreServer must be embedded to have forward compatible implementations.
func (*UnimplementedStoreServer) AnchorMapRef ¶
func (*UnimplementedStoreServer) AnchorMapRef(context.Context, *AnchorMapRefRequest) (*AnchorMapRefResponse, error)
func (*UnimplementedStoreServer) Get ¶
func (*UnimplementedStoreServer) Get(context.Context, *GetRequest) (*GetResponse, error)
func (*UnimplementedStoreServer) ListRefs ¶
func (*UnimplementedStoreServer) ListRefs(*ListRefsRequest, Store_ListRefsServer) error
func (*UnimplementedStoreServer) Put ¶
func (*UnimplementedStoreServer) Put(context.Context, *PutRequest) (*PutResponse, error)
func (*UnimplementedStoreServer) UpdateAnchorMap ¶
func (*UnimplementedStoreServer) UpdateAnchorMap(context.Context, *UpdateAnchorMapRequest) (*UpdateAnchorMapResponse, error)
type UpdateAnchorMapRequest ¶
type UpdateAnchorMapRequest struct { OldRef []byte `protobuf:"bytes,1,opt,name=old_ref,json=oldRef,proto3" json:"old_ref,omitempty"` NewRef []byte `protobuf:"bytes,2,opt,name=new_ref,json=newRef,proto3" json:"new_ref,omitempty"` // contains filtered or unexported fields }
func (*UpdateAnchorMapRequest) Descriptor
deprecated
func (*UpdateAnchorMapRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateAnchorMapRequest.ProtoReflect.Descriptor instead.
func (*UpdateAnchorMapRequest) GetNewRef ¶
func (x *UpdateAnchorMapRequest) GetNewRef() []byte
func (*UpdateAnchorMapRequest) GetOldRef ¶
func (x *UpdateAnchorMapRequest) GetOldRef() []byte
func (*UpdateAnchorMapRequest) ProtoMessage ¶
func (*UpdateAnchorMapRequest) ProtoMessage()
func (*UpdateAnchorMapRequest) ProtoReflect ¶
func (x *UpdateAnchorMapRequest) ProtoReflect() protoreflect.Message
func (*UpdateAnchorMapRequest) Reset ¶
func (x *UpdateAnchorMapRequest) Reset()
func (*UpdateAnchorMapRequest) String ¶
func (x *UpdateAnchorMapRequest) String() string
type UpdateAnchorMapResponse ¶
type UpdateAnchorMapResponse struct {
// contains filtered or unexported fields
}
func (*UpdateAnchorMapResponse) Descriptor
deprecated
func (*UpdateAnchorMapResponse) Descriptor() ([]byte, []int)
Deprecated: Use UpdateAnchorMapResponse.ProtoReflect.Descriptor instead.
func (*UpdateAnchorMapResponse) ProtoMessage ¶
func (*UpdateAnchorMapResponse) ProtoMessage()
func (*UpdateAnchorMapResponse) ProtoReflect ¶
func (x *UpdateAnchorMapResponse) ProtoReflect() protoreflect.Message
func (*UpdateAnchorMapResponse) Reset ¶
func (x *UpdateAnchorMapResponse) Reset()
func (*UpdateAnchorMapResponse) String ¶
func (x *UpdateAnchorMapResponse) String() string