forked from delimitrou/DeathStarBench
/
user.pb.go
158 lines (134 loc) · 5.1 KB
/
user.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
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: user.proto
package user
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.ProtoPackageIsVersion2 // please upgrade the proto package
type Request struct {
Username string `protobuf:"bytes,1,opt,name=username" json:"username,omitempty"`
Password string `protobuf:"bytes,2,opt,name=password" json:"password,omitempty"`
}
func (m *Request) Reset() { *m = Request{} }
func (m *Request) String() string { return proto.CompactTextString(m) }
func (*Request) ProtoMessage() {}
func (*Request) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *Request) GetUsername() string {
if m != nil {
return m.Username
}
return ""
}
func (m *Request) GetPassword() string {
if m != nil {
return m.Password
}
return ""
}
type Result struct {
Correct bool `protobuf:"varint,1,opt,name=correct" json:"correct,omitempty"`
}
func (m *Result) Reset() { *m = Result{} }
func (m *Result) String() string { return proto.CompactTextString(m) }
func (*Result) ProtoMessage() {}
func (*Result) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *Result) GetCorrect() bool {
if m != nil {
return m.Correct
}
return false
}
func init() {
proto.RegisterType((*Request)(nil), "user.Request")
proto.RegisterType((*Result)(nil), "user.Result")
}
// 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
// UserClient is the client API for User service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type UserClient interface {
// CheckUser returns whether the username and password are correct
CheckUser(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Result, error)
}
type userClient struct {
cc *grpc.ClientConn
}
func NewUserClient(cc *grpc.ClientConn) UserClient {
return &userClient{cc}
}
func (c *userClient) CheckUser(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Result, error) {
out := new(Result)
err := c.cc.Invoke(ctx, "/user.User/CheckUser", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// UserServer is the server API for User service.
type UserServer interface {
// CheckUser returns whether the username and password are correct
CheckUser(context.Context, *Request) (*Result, error)
}
func RegisterUserServer(s *grpc.Server, srv UserServer) {
s.RegisterService(&_User_serviceDesc, srv)
}
func _User_CheckUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).CheckUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/user.User/CheckUser",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).CheckUser(ctx, req.(*Request))
}
return interceptor(ctx, in, info, handler)
}
var _User_serviceDesc = grpc.ServiceDesc{
ServiceName: "user.User",
HandlerType: (*UserServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CheckUser",
Handler: _User_CheckUser_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "user.proto",
}
func init() { proto.RegisterFile("user.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 148 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0x2d, 0x4e, 0x2d,
0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x01, 0xb1, 0x95, 0x1c, 0xb9, 0xd8, 0x83, 0x52,
0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, 0xa4, 0xb8, 0x38, 0x40, 0x42, 0x79, 0x89, 0xb9, 0xa9, 0x12,
0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x70, 0x3e, 0x48, 0xae, 0x20, 0xb1, 0xb8, 0xb8, 0x3c, 0xbf,
0x28, 0x45, 0x82, 0x09, 0x22, 0x07, 0xe3, 0x2b, 0x29, 0x71, 0xb1, 0x05, 0xa5, 0x16, 0x97, 0xe6,
0x94, 0x08, 0x49, 0x70, 0xb1, 0x27, 0xe7, 0x17, 0x15, 0xa5, 0x26, 0x97, 0x80, 0x0d, 0xe0, 0x08,
0x82, 0x71, 0x8d, 0x0c, 0xb8, 0x58, 0x42, 0x8b, 0x53, 0x8b, 0x84, 0x34, 0xb8, 0x38, 0x9d, 0x33,
0x52, 0x93, 0xb3, 0xc1, 0x1c, 0x5e, 0x3d, 0xb0, 0x73, 0xa0, 0xf6, 0x4b, 0xf1, 0xc0, 0xb8, 0x20,
0xb3, 0x92, 0xd8, 0xc0, 0xae, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xa0, 0x5b, 0x32, 0xc0,
0xb3, 0x00, 0x00, 0x00,
}