619 lines
20 KiB
Go
619 lines
20 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: micro/go-micro/store/service/proto/store.proto
|
|
|
|
package go_micro_store
|
|
|
|
import (
|
|
context "context"
|
|
fmt "fmt"
|
|
proto "github.com/golang/protobuf/proto"
|
|
grpc "google.golang.org/grpc"
|
|
math "math"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
|
|
|
type Record struct {
|
|
// key of the record
|
|
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
|
|
// value in the record
|
|
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
|
// timestamp in unix seconds
|
|
Expiry int64 `protobuf:"varint,3,opt,name=expiry,proto3" json:"expiry,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Record) Reset() { *m = Record{} }
|
|
func (m *Record) String() string { return proto.CompactTextString(m) }
|
|
func (*Record) ProtoMessage() {}
|
|
func (*Record) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_f84ccc98e143ed3e, []int{0}
|
|
}
|
|
|
|
func (m *Record) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_Record.Unmarshal(m, b)
|
|
}
|
|
func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_Record.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *Record) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Record.Merge(m, src)
|
|
}
|
|
func (m *Record) XXX_Size() int {
|
|
return xxx_messageInfo_Record.Size(m)
|
|
}
|
|
func (m *Record) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Record.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Record proto.InternalMessageInfo
|
|
|
|
func (m *Record) GetKey() string {
|
|
if m != nil {
|
|
return m.Key
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Record) GetValue() []byte {
|
|
if m != nil {
|
|
return m.Value
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Record) GetExpiry() int64 {
|
|
if m != nil {
|
|
return m.Expiry
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type ReadRequest struct {
|
|
Keys []string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *ReadRequest) Reset() { *m = ReadRequest{} }
|
|
func (m *ReadRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*ReadRequest) ProtoMessage() {}
|
|
func (*ReadRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_f84ccc98e143ed3e, []int{1}
|
|
}
|
|
|
|
func (m *ReadRequest) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_ReadRequest.Unmarshal(m, b)
|
|
}
|
|
func (m *ReadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_ReadRequest.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *ReadRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_ReadRequest.Merge(m, src)
|
|
}
|
|
func (m *ReadRequest) XXX_Size() int {
|
|
return xxx_messageInfo_ReadRequest.Size(m)
|
|
}
|
|
func (m *ReadRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_ReadRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_ReadRequest proto.InternalMessageInfo
|
|
|
|
func (m *ReadRequest) GetKeys() []string {
|
|
if m != nil {
|
|
return m.Keys
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type ReadResponse struct {
|
|
Records []*Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *ReadResponse) Reset() { *m = ReadResponse{} }
|
|
func (m *ReadResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*ReadResponse) ProtoMessage() {}
|
|
func (*ReadResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_f84ccc98e143ed3e, []int{2}
|
|
}
|
|
|
|
func (m *ReadResponse) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_ReadResponse.Unmarshal(m, b)
|
|
}
|
|
func (m *ReadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_ReadResponse.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *ReadResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_ReadResponse.Merge(m, src)
|
|
}
|
|
func (m *ReadResponse) XXX_Size() int {
|
|
return xxx_messageInfo_ReadResponse.Size(m)
|
|
}
|
|
func (m *ReadResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_ReadResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_ReadResponse proto.InternalMessageInfo
|
|
|
|
func (m *ReadResponse) GetRecords() []*Record {
|
|
if m != nil {
|
|
return m.Records
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type WriteRequest struct {
|
|
Records []*Record `protobuf:"bytes,2,rep,name=records,proto3" json:"records,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *WriteRequest) Reset() { *m = WriteRequest{} }
|
|
func (m *WriteRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*WriteRequest) ProtoMessage() {}
|
|
func (*WriteRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_f84ccc98e143ed3e, []int{3}
|
|
}
|
|
|
|
func (m *WriteRequest) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_WriteRequest.Unmarshal(m, b)
|
|
}
|
|
func (m *WriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_WriteRequest.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *WriteRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_WriteRequest.Merge(m, src)
|
|
}
|
|
func (m *WriteRequest) XXX_Size() int {
|
|
return xxx_messageInfo_WriteRequest.Size(m)
|
|
}
|
|
func (m *WriteRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_WriteRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_WriteRequest proto.InternalMessageInfo
|
|
|
|
func (m *WriteRequest) GetRecords() []*Record {
|
|
if m != nil {
|
|
return m.Records
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type WriteResponse struct {
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *WriteResponse) Reset() { *m = WriteResponse{} }
|
|
func (m *WriteResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*WriteResponse) ProtoMessage() {}
|
|
func (*WriteResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_f84ccc98e143ed3e, []int{4}
|
|
}
|
|
|
|
func (m *WriteResponse) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_WriteResponse.Unmarshal(m, b)
|
|
}
|
|
func (m *WriteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_WriteResponse.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *WriteResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_WriteResponse.Merge(m, src)
|
|
}
|
|
func (m *WriteResponse) XXX_Size() int {
|
|
return xxx_messageInfo_WriteResponse.Size(m)
|
|
}
|
|
func (m *WriteResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_WriteResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_WriteResponse proto.InternalMessageInfo
|
|
|
|
type DeleteRequest struct {
|
|
Keys []string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *DeleteRequest) Reset() { *m = DeleteRequest{} }
|
|
func (m *DeleteRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*DeleteRequest) ProtoMessage() {}
|
|
func (*DeleteRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_f84ccc98e143ed3e, []int{5}
|
|
}
|
|
|
|
func (m *DeleteRequest) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_DeleteRequest.Unmarshal(m, b)
|
|
}
|
|
func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_DeleteRequest.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *DeleteRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_DeleteRequest.Merge(m, src)
|
|
}
|
|
func (m *DeleteRequest) XXX_Size() int {
|
|
return xxx_messageInfo_DeleteRequest.Size(m)
|
|
}
|
|
func (m *DeleteRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_DeleteRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_DeleteRequest proto.InternalMessageInfo
|
|
|
|
func (m *DeleteRequest) GetKeys() []string {
|
|
if m != nil {
|
|
return m.Keys
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type DeleteResponse struct {
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *DeleteResponse) Reset() { *m = DeleteResponse{} }
|
|
func (m *DeleteResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*DeleteResponse) ProtoMessage() {}
|
|
func (*DeleteResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_f84ccc98e143ed3e, []int{6}
|
|
}
|
|
|
|
func (m *DeleteResponse) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_DeleteResponse.Unmarshal(m, b)
|
|
}
|
|
func (m *DeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_DeleteResponse.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *DeleteResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_DeleteResponse.Merge(m, src)
|
|
}
|
|
func (m *DeleteResponse) XXX_Size() int {
|
|
return xxx_messageInfo_DeleteResponse.Size(m)
|
|
}
|
|
func (m *DeleteResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_DeleteResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_DeleteResponse proto.InternalMessageInfo
|
|
|
|
type SyncRequest struct {
|
|
// optional key
|
|
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *SyncRequest) Reset() { *m = SyncRequest{} }
|
|
func (m *SyncRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*SyncRequest) ProtoMessage() {}
|
|
func (*SyncRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_f84ccc98e143ed3e, []int{7}
|
|
}
|
|
|
|
func (m *SyncRequest) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_SyncRequest.Unmarshal(m, b)
|
|
}
|
|
func (m *SyncRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_SyncRequest.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *SyncRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_SyncRequest.Merge(m, src)
|
|
}
|
|
func (m *SyncRequest) XXX_Size() int {
|
|
return xxx_messageInfo_SyncRequest.Size(m)
|
|
}
|
|
func (m *SyncRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_SyncRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_SyncRequest proto.InternalMessageInfo
|
|
|
|
func (m *SyncRequest) GetKey() string {
|
|
if m != nil {
|
|
return m.Key
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type SyncResponse struct {
|
|
Records []*Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *SyncResponse) Reset() { *m = SyncResponse{} }
|
|
func (m *SyncResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*SyncResponse) ProtoMessage() {}
|
|
func (*SyncResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_f84ccc98e143ed3e, []int{8}
|
|
}
|
|
|
|
func (m *SyncResponse) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_SyncResponse.Unmarshal(m, b)
|
|
}
|
|
func (m *SyncResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_SyncResponse.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *SyncResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_SyncResponse.Merge(m, src)
|
|
}
|
|
func (m *SyncResponse) XXX_Size() int {
|
|
return xxx_messageInfo_SyncResponse.Size(m)
|
|
}
|
|
func (m *SyncResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_SyncResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_SyncResponse proto.InternalMessageInfo
|
|
|
|
func (m *SyncResponse) GetRecords() []*Record {
|
|
if m != nil {
|
|
return m.Records
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*Record)(nil), "go.micro.store.Record")
|
|
proto.RegisterType((*ReadRequest)(nil), "go.micro.store.ReadRequest")
|
|
proto.RegisterType((*ReadResponse)(nil), "go.micro.store.ReadResponse")
|
|
proto.RegisterType((*WriteRequest)(nil), "go.micro.store.WriteRequest")
|
|
proto.RegisterType((*WriteResponse)(nil), "go.micro.store.WriteResponse")
|
|
proto.RegisterType((*DeleteRequest)(nil), "go.micro.store.DeleteRequest")
|
|
proto.RegisterType((*DeleteResponse)(nil), "go.micro.store.DeleteResponse")
|
|
proto.RegisterType((*SyncRequest)(nil), "go.micro.store.SyncRequest")
|
|
proto.RegisterType((*SyncResponse)(nil), "go.micro.store.SyncResponse")
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterFile("micro/go-micro/store/service/proto/store.proto", fileDescriptor_f84ccc98e143ed3e)
|
|
}
|
|
|
|
var fileDescriptor_f84ccc98e143ed3e = []byte{
|
|
// 333 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xcb, 0x6e, 0xf2, 0x30,
|
|
0x10, 0x85, 0x09, 0x81, 0xfc, 0x62, 0xb8, 0xfc, 0x68, 0x54, 0xa1, 0x88, 0xde, 0xd2, 0x74, 0x93,
|
|
0x4d, 0x03, 0xa2, 0x2f, 0x50, 0xa9, 0x17, 0xb5, 0x5b, 0xb3, 0xe8, 0x9a, 0x86, 0x11, 0x8a, 0xa0,
|
|
0x98, 0x3a, 0x01, 0x35, 0x2f, 0xd4, 0xe7, 0xac, 0x6c, 0x27, 0x69, 0x90, 0x41, 0xaa, 0xba, 0x1b,
|
|
0x7b, 0xce, 0x1c, 0x9f, 0xf9, 0x64, 0x08, 0xdf, 0xe3, 0x48, 0xf0, 0xd1, 0x82, 0xdf, 0xe8, 0x22,
|
|
0x49, 0xb9, 0xa0, 0x51, 0x42, 0x62, 0x17, 0x47, 0x34, 0xda, 0x08, 0x9e, 0xe6, 0x77, 0xa1, 0xaa,
|
|
0xb1, 0xb7, 0xe0, 0x7a, 0x24, 0x54, 0xb7, 0xfe, 0x33, 0x38, 0x8c, 0x22, 0x2e, 0xe6, 0xd8, 0x07,
|
|
0x7b, 0x49, 0x99, 0x6b, 0x79, 0x56, 0xd0, 0x62, 0xb2, 0xc4, 0x13, 0x68, 0xee, 0x66, 0xab, 0x2d,
|
|
0xb9, 0x75, 0xcf, 0x0a, 0x3a, 0x4c, 0x1f, 0x70, 0x00, 0x0e, 0x7d, 0x6e, 0x62, 0x91, 0xb9, 0xb6,
|
|
0x67, 0x05, 0x36, 0xcb, 0x4f, 0xfe, 0x15, 0xb4, 0x19, 0xcd, 0xe6, 0x8c, 0x3e, 0xb6, 0x94, 0xa4,
|
|
0x88, 0xd0, 0x58, 0x52, 0x96, 0xb8, 0x96, 0x67, 0x07, 0x2d, 0xa6, 0x6a, 0xff, 0x0e, 0x3a, 0x5a,
|
|
0x92, 0x6c, 0xf8, 0x3a, 0x21, 0x1c, 0xc3, 0x3f, 0xa1, 0x1e, 0xd7, 0xb2, 0xf6, 0x64, 0x10, 0xee,
|
|
0xc7, 0x0b, 0x75, 0x36, 0x56, 0xc8, 0xa4, 0xc3, 0xab, 0x88, 0x53, 0x2a, 0x5e, 0xa9, 0x38, 0xd4,
|
|
0x7f, 0xe7, 0xf0, 0x1f, 0xba, 0xb9, 0x83, 0x0e, 0xe1, 0x5f, 0x43, 0xf7, 0x81, 0x56, 0xf4, 0xe3,
|
|
0x79, 0x28, 0x79, 0x1f, 0x7a, 0x85, 0x28, 0x1f, 0xbb, 0x84, 0xf6, 0x34, 0x5b, 0x47, 0xc5, 0x90,
|
|
0x41, 0x4f, 0x46, 0xd5, 0x82, 0xbf, 0x2e, 0x3b, 0xf9, 0xaa, 0x43, 0x73, 0x2a, 0x3b, 0x78, 0x0f,
|
|
0x0d, 0x09, 0x0e, 0x4f, 0xcd, 0x91, 0x92, 0xf8, 0xf0, 0xec, 0x70, 0x33, 0xcf, 0x5b, 0xc3, 0x27,
|
|
0x68, 0xaa, 0xcd, 0xd1, 0x10, 0x56, 0x91, 0x0e, 0xcf, 0x8f, 0x74, 0x4b, 0x9f, 0x17, 0x70, 0x34,
|
|
0x0b, 0x34, 0xa4, 0x7b, 0x20, 0x87, 0x17, 0xc7, 0xda, 0xa5, 0xd5, 0x23, 0x34, 0x24, 0x23, 0x73,
|
|
0xaf, 0x0a, 0x5a, 0x73, 0xaf, 0x2a, 0x56, 0xbf, 0x36, 0xb6, 0xde, 0x1c, 0xf5, 0xb7, 0x6f, 0xbf,
|
|
0x03, 0x00, 0x00, 0xff, 0xff, 0x30, 0xc8, 0x99, 0x52, 0x0d, 0x03, 0x00, 0x00,
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ grpc.ClientConn
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
const _ = grpc.SupportPackageIsVersion4
|
|
|
|
// StoreClient is the client API for Store service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
type StoreClient interface {
|
|
Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error)
|
|
Write(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error)
|
|
Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
|
|
Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (Store_SyncClient, error)
|
|
}
|
|
|
|
type storeClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewStoreClient(cc *grpc.ClientConn) StoreClient {
|
|
return &storeClient{cc}
|
|
}
|
|
|
|
func (c *storeClient) Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error) {
|
|
out := new(ReadResponse)
|
|
err := c.cc.Invoke(ctx, "/go.micro.store.Store/Read", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *storeClient) Write(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error) {
|
|
out := new(WriteResponse)
|
|
err := c.cc.Invoke(ctx, "/go.micro.store.Store/Write", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *storeClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) {
|
|
out := new(DeleteResponse)
|
|
err := c.cc.Invoke(ctx, "/go.micro.store.Store/Delete", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *storeClient) Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (Store_SyncClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &_Store_serviceDesc.Streams[0], "/go.micro.store.Store/Sync", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &storeSyncClient{stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
type Store_SyncClient interface {
|
|
Recv() (*SyncResponse, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type storeSyncClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *storeSyncClient) Recv() (*SyncResponse, error) {
|
|
m := new(SyncResponse)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
// StoreServer is the server API for Store service.
|
|
type StoreServer interface {
|
|
Read(context.Context, *ReadRequest) (*ReadResponse, error)
|
|
Write(context.Context, *WriteRequest) (*WriteResponse, error)
|
|
Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
|
|
Sync(*SyncRequest, Store_SyncServer) error
|
|
}
|
|
|
|
func RegisterStoreServer(s *grpc.Server, srv StoreServer) {
|
|
s.RegisterService(&_Store_serviceDesc, srv)
|
|
}
|
|
|
|
func _Store_Read_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ReadRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(StoreServer).Read(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/go.micro.store.Store/Read",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(StoreServer).Read(ctx, req.(*ReadRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Store_Write_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(WriteRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(StoreServer).Write(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/go.micro.store.Store/Write",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(StoreServer).Write(ctx, req.(*WriteRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Store_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DeleteRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(StoreServer).Delete(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/go.micro.store.Store/Delete",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(StoreServer).Delete(ctx, req.(*DeleteRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Store_Sync_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(SyncRequest)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(StoreServer).Sync(m, &storeSyncServer{stream})
|
|
}
|
|
|
|
type Store_SyncServer interface {
|
|
Send(*SyncResponse) error
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type storeSyncServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *storeSyncServer) Send(m *SyncResponse) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
var _Store_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "go.micro.store.Store",
|
|
HandlerType: (*StoreServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Read",
|
|
Handler: _Store_Read_Handler,
|
|
},
|
|
{
|
|
MethodName: "Write",
|
|
Handler: _Store_Write_Handler,
|
|
},
|
|
{
|
|
MethodName: "Delete",
|
|
Handler: _Store_Delete_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "Sync",
|
|
Handler: _Store_Sync_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "micro/go-micro/store/service/proto/store.proto",
|
|
}
|