183 lines
6.0 KiB
Go
183 lines
6.0 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: authentication_service.proto
|
|
|
|
/*
|
|
Package authentication is a generated protocol buffer package.
|
|
|
|
It is generated from these files:
|
|
authentication_service.proto
|
|
|
|
It has these top-level messages:
|
|
LoginRequest
|
|
LoginReply
|
|
*/
|
|
package authentication
|
|
|
|
import proto "github.com/golang/protobuf/proto"
|
|
import fmt "fmt"
|
|
import math "math"
|
|
|
|
import (
|
|
context "golang.org/x/net/context"
|
|
grpc "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
|
|
|
|
// The request message containing the user's name, password and client id
|
|
type LoginRequest struct {
|
|
UserName string `protobuf:"bytes,1,opt,name=user_name,json=userName" json:"user_name,omitempty"`
|
|
Password string `protobuf:"bytes,2,opt,name=password" json:"password,omitempty"`
|
|
ClientId string `protobuf:"bytes,3,opt,name=client_id,json=clientId" json:"client_id,omitempty"`
|
|
}
|
|
|
|
func (m *LoginRequest) Reset() { *m = LoginRequest{} }
|
|
func (m *LoginRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*LoginRequest) ProtoMessage() {}
|
|
func (*LoginRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
|
|
|
func (m *LoginRequest) GetUserName() string {
|
|
if m != nil {
|
|
return m.UserName
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *LoginRequest) GetPassword() string {
|
|
if m != nil {
|
|
return m.Password
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *LoginRequest) GetClientId() string {
|
|
if m != nil {
|
|
return m.ClientId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// The response message containing the result of login attempt.
|
|
// result value of true indicates success and false indicates
|
|
// failure
|
|
type LoginReply struct {
|
|
Result bool `protobuf:"varint,1,opt,name=result" json:"result,omitempty"`
|
|
}
|
|
|
|
func (m *LoginReply) Reset() { *m = LoginReply{} }
|
|
func (m *LoginReply) String() string { return proto.CompactTextString(m) }
|
|
func (*LoginReply) ProtoMessage() {}
|
|
func (*LoginReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
|
|
|
func (m *LoginReply) GetResult() bool {
|
|
if m != nil {
|
|
return m.Result
|
|
}
|
|
return false
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*LoginRequest)(nil), "authentication.LoginRequest")
|
|
proto.RegisterType((*LoginReply)(nil), "authentication.LoginReply")
|
|
}
|
|
|
|
// 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 Login service
|
|
|
|
type LoginClient interface {
|
|
LoginCheck(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginReply, error)
|
|
}
|
|
|
|
type loginClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewLoginClient(cc *grpc.ClientConn) LoginClient {
|
|
return &loginClient{cc}
|
|
}
|
|
|
|
func (c *loginClient) LoginCheck(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginReply, error) {
|
|
out := new(LoginReply)
|
|
err := grpc.Invoke(ctx, "/authentication.Login/LoginCheck", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// Server API for Login service
|
|
|
|
type LoginServer interface {
|
|
LoginCheck(context.Context, *LoginRequest) (*LoginReply, error)
|
|
}
|
|
|
|
func RegisterLoginServer(s *grpc.Server, srv LoginServer) {
|
|
s.RegisterService(&_Login_serviceDesc, srv)
|
|
}
|
|
|
|
func _Login_LoginCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(LoginRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LoginServer).LoginCheck(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/authentication.Login/LoginCheck",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LoginServer).LoginCheck(ctx, req.(*LoginRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _Login_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "authentication.Login",
|
|
HandlerType: (*LoginServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "LoginCheck",
|
|
Handler: _Login_LoginCheck_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "authentication_service.proto",
|
|
}
|
|
|
|
func init() { proto.RegisterFile("authentication_service.proto", fileDescriptor0) }
|
|
|
|
var fileDescriptor0 = []byte{
|
|
// 200 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0x2c, 0x2d, 0xc9,
|
|
0x48, 0xcd, 0x2b, 0xc9, 0x4c, 0x4e, 0x2c, 0xc9, 0xcc, 0xcf, 0x8b, 0x2f, 0x4e, 0x2d, 0x2a, 0xcb,
|
|
0x4c, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x43, 0x95, 0x55, 0x4a, 0xe1, 0xe2,
|
|
0xf1, 0xc9, 0x4f, 0xcf, 0xcc, 0x0b, 0x4a,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