forked from itspage/go-platform
/
kv.pb.go
241 lines (200 loc) · 8.52 KB
/
kv.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
// Code generated by protoc-gen-go.
// source: github.com/pydio/go-os/kv/proto/kv.proto
// DO NOT EDIT!
/*
Package go_micro_os_kv is a generated protocol buffer package.
It is generated from these files:
github.com/pydio/go-os/kv/proto/kv.proto
It has these top-level messages:
Item
GetRequest
GetResponse
PutRequest
PutResponse
DelRequest
DelResponse
*/
package go_micro_os_kv
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
client "github.com/micro/go-micro/client"
server "github.com/micro/go-micro/server"
context "golang.org/x/net/context"
)
// 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.ProtoPackageIsVersion2 // please upgrade the proto package
type Item struct {
Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
Expiration int64 `protobuf:"varint,3,opt,name=expiration" json:"expiration,omitempty"`
}
func (m *Item) Reset() { *m = Item{} }
func (m *Item) String() string { return proto.CompactTextString(m) }
func (*Item) ProtoMessage() {}
func (*Item) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
type GetRequest struct {
Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
}
func (m *GetRequest) Reset() { *m = GetRequest{} }
func (m *GetRequest) String() string { return proto.CompactTextString(m) }
func (*GetRequest) ProtoMessage() {}
func (*GetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
type GetResponse struct {
Item *Item `protobuf:"bytes,1,opt,name=item" json:"item,omitempty"`
}
func (m *GetResponse) Reset() { *m = GetResponse{} }
func (m *GetResponse) String() string { return proto.CompactTextString(m) }
func (*GetResponse) ProtoMessage() {}
func (*GetResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *GetResponse) GetItem() *Item {
if m != nil {
return m.Item
}
return nil
}
type PutRequest struct {
Item *Item `protobuf:"bytes,1,opt,name=item" json:"item,omitempty"`
}
func (m *PutRequest) Reset() { *m = PutRequest{} }
func (m *PutRequest) String() string { return proto.CompactTextString(m) }
func (*PutRequest) ProtoMessage() {}
func (*PutRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func (m *PutRequest) GetItem() *Item {
if m != nil {
return m.Item
}
return nil
}
type PutResponse struct {
}
func (m *PutResponse) Reset() { *m = PutResponse{} }
func (m *PutResponse) String() string { return proto.CompactTextString(m) }
func (*PutResponse) ProtoMessage() {}
func (*PutResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
type DelRequest struct {
Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
}
func (m *DelRequest) Reset() { *m = DelRequest{} }
func (m *DelRequest) String() string { return proto.CompactTextString(m) }
func (*DelRequest) ProtoMessage() {}
func (*DelRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
type DelResponse struct {
}
func (m *DelResponse) Reset() { *m = DelResponse{} }
func (m *DelResponse) String() string { return proto.CompactTextString(m) }
func (*DelResponse) ProtoMessage() {}
func (*DelResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
func init() {
proto.RegisterType((*Item)(nil), "go.micro.os.kv.Item")
proto.RegisterType((*GetRequest)(nil), "go.micro.os.kv.GetRequest")
proto.RegisterType((*GetResponse)(nil), "go.micro.os.kv.GetResponse")
proto.RegisterType((*PutRequest)(nil), "go.micro.os.kv.PutRequest")
proto.RegisterType((*PutResponse)(nil), "go.micro.os.kv.PutResponse")
proto.RegisterType((*DelRequest)(nil), "go.micro.os.kv.DelRequest")
proto.RegisterType((*DelResponse)(nil), "go.micro.os.kv.DelResponse")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ client.Option
var _ server.Option
// Client API for KV service
type KVClient interface {
Get(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*GetResponse, error)
Put(ctx context.Context, in *PutRequest, opts ...client.CallOption) (*PutResponse, error)
Del(ctx context.Context, in *DelRequest, opts ...client.CallOption) (*DelResponse, error)
}
type kVClient struct {
c client.Client
serviceName string
}
func NewKVClient(serviceName string, c client.Client) KVClient {
if c == nil {
c = client.NewClient()
}
if len(serviceName) == 0 {
serviceName = "go.micro.os.kv"
}
return &kVClient{
c: c,
serviceName: serviceName,
}
}
func (c *kVClient) Get(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*GetResponse, error) {
req := c.c.NewRequest(c.serviceName, "KV.Get", in)
out := new(GetResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *kVClient) Put(ctx context.Context, in *PutRequest, opts ...client.CallOption) (*PutResponse, error) {
req := c.c.NewRequest(c.serviceName, "KV.Put", in)
out := new(PutResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *kVClient) Del(ctx context.Context, in *DelRequest, opts ...client.CallOption) (*DelResponse, error) {
req := c.c.NewRequest(c.serviceName, "KV.Del", in)
out := new(DelResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for KV service
type KVHandler interface {
Get(context.Context, *GetRequest, *GetResponse) error
Put(context.Context, *PutRequest, *PutResponse) error
Del(context.Context, *DelRequest, *DelResponse) error
}
func RegisterKVHandler(s server.Server, hdlr KVHandler, opts ...server.HandlerOption) {
s.Handle(s.NewHandler(&KV{hdlr}, opts...))
}
type KV struct {
KVHandler
}
func (h *KV) Get(ctx context.Context, in *GetRequest, out *GetResponse) error {
return h.KVHandler.Get(ctx, in, out)
}
func (h *KV) Put(ctx context.Context, in *PutRequest, out *PutResponse) error {
return h.KVHandler.Put(ctx, in, out)
}
func (h *KV) Del(ctx context.Context, in *DelRequest, out *DelResponse) error {
return h.KVHandler.Del(ctx, in, out)
}
func init() { proto.RegisterFile("github.com/pydio/go-os/kv/proto/kv.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 276 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x8c, 0x92, 0x41, 0x4b, 0xc3, 0x40,
0x10, 0x85, 0x9b, 0xa6, 0x0a, 0x4e, 0x54, 0x64, 0xe9, 0x21, 0x54, 0x10, 0xd9, 0x53, 0x2e, 0x6e,
0xa0, 0x82, 0x5e, 0x3d, 0x08, 0x22, 0x82, 0xc8, 0x1e, 0xbc, 0xb7, 0x65, 0x89, 0x4b, 0x9a, 0x4c,
0xcc, 0x6e, 0x82, 0xfe, 0x45, 0x7f, 0x95, 0x9b, 0x89, 0x98, 0xe8, 0x2a, 0xf4, 0x36, 0xd9, 0xf7,
0xe6, 0xcd, 0xf7, 0x20, 0x90, 0x64, 0xda, 0xbe, 0x34, 0x6b, 0xb1, 0xc1, 0x22, 0x2d, 0xf4, 0xa6,
0xc6, 0x34, 0x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