-
Notifications
You must be signed in to change notification settings - Fork 0
/
province_grpc.pb.go
134 lines (118 loc) · 4.29 KB
/
province_grpc.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
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package province
import (
context "context"
empty "github.com/golang/protobuf/ptypes/empty"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// 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.SupportPackageIsVersion7
// ProvinceClient is the client API for Province 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.
type ProvinceClient interface {
Get(ctx context.Context, in *GetReq, opts ...grpc.CallOption) (*Province, error)
GetAll(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Provinces, error)
}
type provinceClient struct {
cc grpc.ClientConnInterface
}
func NewProvinceClient(cc grpc.ClientConnInterface) ProvinceClient {
return &provinceClient{cc}
}
func (c *provinceClient) Get(ctx context.Context, in *GetReq, opts ...grpc.CallOption) (*Province, error) {
out := new(Province)
err := c.cc.Invoke(ctx, "/province.province/Get", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *provinceClient) GetAll(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Provinces, error) {
out := new(Provinces)
err := c.cc.Invoke(ctx, "/province.province/GetAll", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ProvinceServer is the server API for Province service.
// All implementations must embed UnimplementedProvinceServer
// for forward compatibility
type ProvinceServer interface {
Get(context.Context, *GetReq) (*Province, error)
GetAll(context.Context, *empty.Empty) (*Provinces, error)
mustEmbedUnimplementedProvinceServer()
}
// UnimplementedProvinceServer must be embedded to have forward compatible implementations.
type UnimplementedProvinceServer struct {
}
func (UnimplementedProvinceServer) Get(context.Context, *GetReq) (*Province, error) {
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedProvinceServer) GetAll(context.Context, *empty.Empty) (*Provinces, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetAll not implemented")
}
func (UnimplementedProvinceServer) mustEmbedUnimplementedProvinceServer() {}
// UnsafeProvinceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ProvinceServer will
// result in compilation errors.
type UnsafeProvinceServer interface {
mustEmbedUnimplementedProvinceServer()
}
func RegisterProvinceServer(s *grpc.Server, srv ProvinceServer) {
s.RegisterService(&_Province_serviceDesc, srv)
}
func _Province_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ProvinceServer).Get(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/province.province/Get",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ProvinceServer).Get(ctx, req.(*GetReq))
}
return interceptor(ctx, in, info, handler)
}
func _Province_GetAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(empty.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ProvinceServer).GetAll(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/province.province/GetAll",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ProvinceServer).GetAll(ctx, req.(*empty.Empty))
}
return interceptor(ctx, in, info, handler)
}
var _Province_serviceDesc = grpc.ServiceDesc{
ServiceName: "province.province",
HandlerType: (*ProvinceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Get",
Handler: _Province_Get_Handler,
},
{
MethodName: "GetAll",
Handler: _Province_GetAll_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "province.proto",
}