-
Notifications
You must be signed in to change notification settings - Fork 1
/
generated.micro.go
218 lines (188 loc) · 7.96 KB
/
generated.micro.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
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: github.com/kennyzhu/go-os/dbservice/tools/example/protos/github.com/kennyzhu/go-os/dbservice/tools/example/generated.proto
/*
Package example is a generated protocol buffer package.
It is generated from these files:
github.com/kennyzhu/go-os/dbservice/tools/example/protos/github.com/kennyzhu/go-os/dbservice/tools/example/generated.proto
It has these top-level messages:
Category
MyDuration
MyTime
Price
Product
GetAlphaTimeRequest
GetDurationForLengthRequest
GetDurationForLengthCtxRequest
GetOmegaTimeRequest
GetPhoneRequest
RandomCategoryRequest
RandomNumberRequest
RandomNumberResponse
*/
package example
import (
proto "github.com/golang/protobuf/proto"
"github.com/kennyzhu/go-os/src/dbservice/tools/example/categories"
)
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import _ "github.com/gogo/protobuf/types"
import (
context "context"
client "github.com/micro/go-micro/client"
server "github.com/micro/go-micro/server"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
var _ = categories.CategoryOptions{}
// 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
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ client.Option
var _ server.Option
// Client API for ExampleService service
type ExampleService interface {
GetAlphaTime(ctx context.Context, in *GetAlphaTimeRequest, opts ...client.CallOption) (*MyTime, error)
GetDurationForLength(ctx context.Context, in *GetDurationForLengthRequest, opts ...client.CallOption) (*MyDuration, error)
GetDurationForLengthCtx(ctx context.Context, in *GetDurationForLengthCtxRequest, opts ...client.CallOption) (*MyDuration, error)
GetOmegaTime(ctx context.Context, in *GetOmegaTimeRequest, opts ...client.CallOption) (*MyTime, error)
GetPhone(ctx context.Context, in *GetPhoneRequest, opts ...client.CallOption) (*Product, error)
RandomCategory(ctx context.Context, in *RandomCategoryRequest, opts ...client.CallOption) (*categories.CategoryOptions, error)
RandomNumber(ctx context.Context, in *RandomNumberRequest, opts ...client.CallOption) (*RandomNumberResponse, error)
}
type exampleService struct {
c client.Client
name string
}
func NewExampleService(name string, c client.Client) ExampleService {
if c == nil {
c = client.NewClient()
}
if len(name) == 0 {
name = "github.com.kennyzhu.goos.dbservice.tools.example"
}
return &exampleService{
c: c,
name: name,
}
}
func (c *exampleService) GetAlphaTime(ctx context.Context, in *GetAlphaTimeRequest, opts ...client.CallOption) (*MyTime, error) {
req := c.c.NewRequest(c.name, "ExampleService.GetAlphaTime", in)
out := new(MyTime)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *exampleService) GetDurationForLength(ctx context.Context, in *GetDurationForLengthRequest, opts ...client.CallOption) (*MyDuration, error) {
req := c.c.NewRequest(c.name, "ExampleService.GetDurationForLength", in)
out := new(MyDuration)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *exampleService) GetDurationForLengthCtx(ctx context.Context, in *GetDurationForLengthCtxRequest, opts ...client.CallOption) (*MyDuration, error) {
req := c.c.NewRequest(c.name, "ExampleService.GetDurationForLengthCtx", in)
out := new(MyDuration)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *exampleService) GetOmegaTime(ctx context.Context, in *GetOmegaTimeRequest, opts ...client.CallOption) (*MyTime, error) {
req := c.c.NewRequest(c.name, "ExampleService.GetOmegaTime", in)
out := new(MyTime)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *exampleService) GetPhone(ctx context.Context, in *GetPhoneRequest, opts ...client.CallOption) (*Product, error) {
req := c.c.NewRequest(c.name, "ExampleService.GetPhone", in)
out := new(Product)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *exampleService) RandomCategory(ctx context.Context, in *RandomCategoryRequest, opts ...client.CallOption) (*categories.CategoryOptions, error) {
req := c.c.NewRequest(c.name, "ExampleService.RandomCategory", in)
out := new(categories.CategoryOptions)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *exampleService) RandomNumber(ctx context.Context, in *RandomNumberRequest, opts ...client.CallOption) (*RandomNumberResponse, error) {
req := c.c.NewRequest(c.name, "ExampleService.RandomNumber", in)
out := new(RandomNumberResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for ExampleService service
type ExampleServiceHandler interface {
GetAlphaTime(context.Context, *GetAlphaTimeRequest, *MyTime) error
GetDurationForLength(context.Context, *GetDurationForLengthRequest, *MyDuration) error
GetDurationForLengthCtx(context.Context, *GetDurationForLengthCtxRequest, *MyDuration) error
GetOmegaTime(context.Context, *GetOmegaTimeRequest, *MyTime) error
GetPhone(context.Context, *GetPhoneRequest, *Product) error
RandomCategory(context.Context, *RandomCategoryRequest, *categories.CategoryOptions) error
RandomNumber(context.Context, *RandomNumberRequest, *RandomNumberResponse) error
}
func RegisterExampleServiceHandler(s server.Server, hdlr ExampleServiceHandler, opts ...server.HandlerOption) {
type exampleService interface {
GetAlphaTime(ctx context.Context, in *GetAlphaTimeRequest, out *MyTime) error
GetDurationForLength(ctx context.Context, in *GetDurationForLengthRequest, out *MyDuration) error
GetDurationForLengthCtx(ctx context.Context, in *GetDurationForLengthCtxRequest, out *MyDuration) error
GetOmegaTime(ctx context.Context, in *GetOmegaTimeRequest, out *MyTime) error
GetPhone(ctx context.Context, in *GetPhoneRequest, out *Product) error
RandomCategory(ctx context.Context, in *RandomCategoryRequest, out *categories.CategoryOptions) error
RandomNumber(ctx context.Context, in *RandomNumberRequest, out *RandomNumberResponse) error
}
type ExampleService struct {
exampleService
}
h := &exampleServiceHandler{hdlr}
s.Handle(s.NewHandler(&ExampleService{h}, opts...))
}
type exampleServiceHandler struct {
ExampleServiceHandler
}
func (h *exampleServiceHandler) GetAlphaTime(ctx context.Context, in *GetAlphaTimeRequest, out *MyTime) error {
return h.ExampleServiceHandler.GetAlphaTime(ctx, in, out)
}
func (h *exampleServiceHandler) GetDurationForLength(ctx context.Context, in *GetDurationForLengthRequest, out *MyDuration) error {
return h.ExampleServiceHandler.GetDurationForLength(ctx, in, out)
}
func (h *exampleServiceHandler) GetDurationForLengthCtx(ctx context.Context, in *GetDurationForLengthCtxRequest, out *MyDuration) error {
return h.ExampleServiceHandler.GetDurationForLengthCtx(ctx, in, out)
}
func (h *exampleServiceHandler) GetOmegaTime(ctx context.Context, in *GetOmegaTimeRequest, out *MyTime) error {
return h.ExampleServiceHandler.GetOmegaTime(ctx, in, out)
}
func (h *exampleServiceHandler) GetPhone(ctx context.Context, in *GetPhoneRequest, out *Product) error {
return h.ExampleServiceHandler.GetPhone(ctx, in, out)
}
func (h *exampleServiceHandler) RandomCategory(ctx context.Context, in *RandomCategoryRequest, out *categories.CategoryOptions) error {
return h.ExampleServiceHandler.RandomCategory(ctx, in, out)
}
func (h *exampleServiceHandler) RandomNumber(ctx context.Context, in *RandomNumberRequest, out *RandomNumberResponse) error {
return h.ExampleServiceHandler.RandomNumber(ctx, in, out)
}