|
|
|
// Code generated by protoc-gen-go.
|
|
|
|
// source: user.proto
|
|
|
|
// DO NOT EDIT!
|
|
|
|
|
|
|
|
/*
|
|
|
|
Package user is a generated protocol buffer package.
|
|
|
|
|
|
|
|
It is generated from these files:
|
|
|
|
user.proto
|
|
|
|
|
|
|
|
It has these top-level messages:
|
|
|
|
UserRequest
|
|
|
|
UserResponse
|
|
|
|
*/
|
|
|
|
package user
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"math"
|
|
|
|
|
|
|
|
"github.com/golang/protobuf/proto"
|
|
|
|
"golang.org/x/net/context"
|
|
|
|
"google.golang.org/grpc"
|
|
|
|
)
|
|
|
|
|
|
|
|
// 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 UserRequest struct {
|
|
|
|
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *UserRequest) Reset() { *m = UserRequest{} }
|
|
|
|
func (m *UserRequest) String() string { return proto.CompactTextString(m) }
|
|
|
|
func (*UserRequest) ProtoMessage() {}
|
|
|
|
func (*UserRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
|
|
|
|
|
|
|
func (m *UserRequest) GetName() string {
|
|
|
|
if m != nil {
|
|
|
|
return m.Name
|
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
type UserResponse struct {
|
|
|
|
Response string `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *UserResponse) Reset() { *m = UserResponse{} }
|
|
|
|
func (m *UserResponse) String() string { return proto.CompactTextString(m) }
|
|
|
|
func (*UserResponse) ProtoMessage() {}
|
|
|
|
func (*UserResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
|
|
|
|
|
|
|
func (m *UserResponse) GetResponse() string {
|
|
|
|
if m != nil {
|
|
|
|
return m.Response
|
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
proto.RegisterType((*UserRequest)(nil), "user.UserRequest")
|
|
|
|
proto.RegisterType((*UserResponse)(nil), "user.UserResponse")
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
|
|
// Client API for User service
|
|
|
|
|
|
|
|
type UserClient interface {
|
|
|
|
GetGrade(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*UserResponse, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
type userClient struct {
|
|
|
|
cc *grpc.ClientConn
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewUserClient(cc *grpc.ClientConn) UserClient {
|
|
|
|
return &userClient{cc}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *userClient) GetGrade(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*UserResponse, error) {
|
|
|
|
out := new(UserResponse)
|
|
|
|
err := grpc.Invoke(ctx, "/user.User/GetGrade", in, out, c.cc, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return out, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Server API for User service
|
|
|
|
|
|
|
|
type UserServer interface {
|
|
|
|
GetGrade(context.Context, *UserRequest) (*UserResponse, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
func RegisterUserServer(s *grpc.Server, srv UserServer) {
|
|
|
|
s.RegisterService(&_User_serviceDesc, srv)
|
|
|
|
}
|
|
|
|
|
|
|
|
func _User_GetGrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
|
|
in := new(UserRequest)
|
|
|
|
if err := dec(in); err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
if interceptor == nil {
|
|
|
|
return srv.(UserServer).GetGrade(ctx, in)
|
|
|
|
}
|
|
|
|
info := &grpc.UnaryServerInfo{
|
|
|
|
Server: srv,
|
|
|
|
FullMethod: "/user.User/GetGrade",
|
|
|
|
}
|
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
|
|
return srv.(UserServer).GetGrade(ctx, req.(*UserRequest))
|
|
|
|
}
|
|
|
|
return interceptor(ctx, in, info, handler)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _User_serviceDesc = grpc.ServiceDesc{
|
|
|
|
ServiceName: "user.User",
|
|
|
|
HandlerType: (*UserServer)(nil),
|
|
|
|
Methods: []grpc.MethodDesc{
|
|
|
|
{
|
|
|
|
MethodName: "GetGrade",
|
|
|
|
Handler: _User_GetGrade_Handler,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Streams: []grpc.StreamDesc{},
|
|
|
|
Metadata: "user.proto",
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() { proto.RegisterFile("user.proto", fileDescriptor0) }
|
|
|
|
|
|
|
|
var fileDescriptor0 = []byte{
|
|
|
|
// 131 bytes of a gzipped FileDescriptorProto
|
|
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0x2d, 0x4e, 0x2d,
|
|
|
|
0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x01, 0xb1, 0x95, 0x14, 0xb9, 0xb8, 0x43, 0x8b,
|
|
|
|
0x53, 0x8b, 0x82, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, 0x84, 0xb8, 0x58, 0xf2, 0x12, 0x73,
|
|
|
|
0x53, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0xc0, 0x6c, 0x25, 0x2d, 0x2e, 0x1e, 0x88, 0x92,
|
|
|
|
0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0x21, 0x29, 0x2e, 0x8e, 0x22, 0x28, 0x1b, 0xaa, 0x0e, 0xce,
|
|
|
|
0x37, 0xb2, 0xe4, 0x62, 0x01, 0xa9, 0x15, 0x32, 0xe4, 0xe2, 0x70, 0x4f, 0x2d, 0x71, 0x2f, 0x4a,
|
|
|
|
0x4c, 0x49, 0x15, 0x12, 0xd4, 0x03, 0xdb, 0x8a, 0x64, 0x8d, 0x94, 0x10, 0xb2, 0x10, 0x44, 0x6b,
|
|
|
|
0x12, 0x1b, 0xd8, 0x59, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x99, 0xfd, 0x8f, 0x70, 0xa4,
|
|
|
|
0x00, 0x00, 0x00,
|
|
|
|
}
|