auth.pb.go 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: auth.proto
  3. package pb
  4. import proto "github.com/golang/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. import _ "google.golang.org/genproto/googleapis/api/annotations"
  8. import (
  9. context "golang.org/x/net/context"
  10. grpc "google.golang.org/grpc"
  11. )
  12. // Reference imports to suppress errors if they are not otherwise used.
  13. var _ = proto.Marshal
  14. var _ = fmt.Errorf
  15. var _ = math.Inf
  16. type AuthStatusRequest struct {
  17. }
  18. func (m *AuthStatusRequest) Reset() { *m = AuthStatusRequest{} }
  19. func (m *AuthStatusRequest) String() string { return proto.CompactTextString(m) }
  20. func (*AuthStatusRequest) ProtoMessage() {}
  21. func (*AuthStatusRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} }
  22. type AuthAuthenticateRequest struct {
  23. Username string `protobuf:"bytes,1,opt,name=username" json:"username,omitempty"`
  24. Password string `protobuf:"bytes,2,opt,name=password" json:"password,omitempty"`
  25. }
  26. func (m *AuthAuthenticateRequest) Reset() { *m = AuthAuthenticateRequest{} }
  27. func (m *AuthAuthenticateRequest) String() string { return proto.CompactTextString(m) }
  28. func (*AuthAuthenticateRequest) ProtoMessage() {}
  29. func (*AuthAuthenticateRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} }
  30. func (m *AuthAuthenticateRequest) GetUsername() string {
  31. if m != nil {
  32. return m.Username
  33. }
  34. return ""
  35. }
  36. func (m *AuthAuthenticateRequest) GetPassword() string {
  37. if m != nil {
  38. return m.Password
  39. }
  40. return ""
  41. }
  42. type AuthStatusResponse struct {
  43. User *UserResponse_User `protobuf:"bytes,1,opt,name=user" json:"user,omitempty"`
  44. IsRoot bool `protobuf:"varint,2,opt,name=is_root,json=isRoot" json:"is_root,omitempty"`
  45. }
  46. func (m *AuthStatusResponse) Reset() { *m = AuthStatusResponse{} }
  47. func (m *AuthStatusResponse) String() string { return proto.CompactTextString(m) }
  48. func (*AuthStatusResponse) ProtoMessage() {}
  49. func (*AuthStatusResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{2} }
  50. func (m *AuthStatusResponse) GetUser() *UserResponse_User {
  51. if m != nil {
  52. return m.User
  53. }
  54. return nil
  55. }
  56. func (m *AuthStatusResponse) GetIsRoot() bool {
  57. if m != nil {
  58. return m.IsRoot
  59. }
  60. return false
  61. }
  62. type AuthAuthenticateResponse struct {
  63. Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"`
  64. }
  65. func (m *AuthAuthenticateResponse) Reset() { *m = AuthAuthenticateResponse{} }
  66. func (m *AuthAuthenticateResponse) String() string { return proto.CompactTextString(m) }
  67. func (*AuthAuthenticateResponse) ProtoMessage() {}
  68. func (*AuthAuthenticateResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{3} }
  69. func (m *AuthAuthenticateResponse) GetToken() string {
  70. if m != nil {
  71. return m.Token
  72. }
  73. return ""
  74. }
  75. func init() {
  76. proto.RegisterType((*AuthStatusRequest)(nil), "pb.AuthStatusRequest")
  77. proto.RegisterType((*AuthAuthenticateRequest)(nil), "pb.AuthAuthenticateRequest")
  78. proto.RegisterType((*AuthStatusResponse)(nil), "pb.AuthStatusResponse")
  79. proto.RegisterType((*AuthAuthenticateResponse)(nil), "pb.AuthAuthenticateResponse")
  80. }
  81. // Reference imports to suppress errors if they are not otherwise used.
  82. var _ context.Context
  83. var _ grpc.ClientConn
  84. // This is a compile-time assertion to ensure that this generated file
  85. // is compatible with the grpc package it is being compiled against.
  86. const _ = grpc.SupportPackageIsVersion4
  87. // Client API for AuthService service
  88. type AuthServiceClient interface {
  89. Status(ctx context.Context, in *AuthStatusRequest, opts ...grpc.CallOption) (*AuthStatusResponse, error)
  90. Authenticate(ctx context.Context, in *AuthAuthenticateRequest, opts ...grpc.CallOption) (*AuthAuthenticateResponse, error)
  91. }
  92. type authServiceClient struct {
  93. cc *grpc.ClientConn
  94. }
  95. func NewAuthServiceClient(cc *grpc.ClientConn) AuthServiceClient {
  96. return &authServiceClient{cc}
  97. }
  98. func (c *authServiceClient) Status(ctx context.Context, in *AuthStatusRequest, opts ...grpc.CallOption) (*AuthStatusResponse, error) {
  99. out := new(AuthStatusResponse)
  100. err := grpc.Invoke(ctx, "/pb.AuthService/Status", in, out, c.cc, opts...)
  101. if err != nil {
  102. return nil, err
  103. }
  104. return out, nil
  105. }
  106. func (c *authServiceClient) Authenticate(ctx context.Context, in *AuthAuthenticateRequest, opts ...grpc.CallOption) (*AuthAuthenticateResponse, error) {
  107. out := new(AuthAuthenticateResponse)
  108. err := grpc.Invoke(ctx, "/pb.AuthService/Authenticate", in, out, c.cc, opts...)
  109. if err != nil {
  110. return nil, err
  111. }
  112. return out, nil
  113. }
  114. // Server API for AuthService service
  115. type AuthServiceServer interface {
  116. Status(context.Context, *AuthStatusRequest) (*AuthStatusResponse, error)
  117. Authenticate(context.Context, *AuthAuthenticateRequest) (*AuthAuthenticateResponse, error)
  118. }
  119. func RegisterAuthServiceServer(s *grpc.Server, srv AuthServiceServer) {
  120. s.RegisterService(&_AuthService_serviceDesc, srv)
  121. }
  122. func _AuthService_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  123. in := new(AuthStatusRequest)
  124. if err := dec(in); err != nil {
  125. return nil, err
  126. }
  127. if interceptor == nil {
  128. return srv.(AuthServiceServer).Status(ctx, in)
  129. }
  130. info := &grpc.UnaryServerInfo{
  131. Server: srv,
  132. FullMethod: "/pb.AuthService/Status",
  133. }
  134. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  135. return srv.(AuthServiceServer).Status(ctx, req.(*AuthStatusRequest))
  136. }
  137. return interceptor(ctx, in, info, handler)
  138. }
  139. func _AuthService_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  140. in := new(AuthAuthenticateRequest)
  141. if err := dec(in); err != nil {
  142. return nil, err
  143. }
  144. if interceptor == nil {
  145. return srv.(AuthServiceServer).Authenticate(ctx, in)
  146. }
  147. info := &grpc.UnaryServerInfo{
  148. Server: srv,
  149. FullMethod: "/pb.AuthService/Authenticate",
  150. }
  151. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  152. return srv.(AuthServiceServer).Authenticate(ctx, req.(*AuthAuthenticateRequest))
  153. }
  154. return interceptor(ctx, in, info, handler)
  155. }
  156. var _AuthService_serviceDesc = grpc.ServiceDesc{
  157. ServiceName: "pb.AuthService",
  158. HandlerType: (*AuthServiceServer)(nil),
  159. Methods: []grpc.MethodDesc{
  160. {
  161. MethodName: "Status",
  162. Handler: _AuthService_Status_Handler,
  163. },
  164. {
  165. MethodName: "Authenticate",
  166. Handler: _AuthService_Authenticate_Handler,
  167. },
  168. },
  169. Streams: []grpc.StreamDesc{},
  170. Metadata: "auth.proto",
  171. }
  172. func init() { proto.RegisterFile("auth.proto", fileDescriptor3) }
  173. var fileDescriptor3 = []byte{
  174. // 306 bytes of a gzipped FileDescriptorProto
  175. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x51, 0x41, 0x4e, 0x2a, 0x41,
  176. 0x10, 0xcd, 0x90, 0xff, 0x11, 0x0b, 0x37, 0x36, 0x22, 0x38, 0x10, 0x63, 0x26, 0x2e, 0xd4, 0x05,
  177. 0xa3, 0xb8, 0x73, 0xe7, 0x11, 0x1c, 0x35, 0x71, 0x67, 0x1a, 0xac, 0xc0, 0x44, 0xed, 0x1a, 0xbb,
  178. 0x6a, 0x70, 0xef, 0x15, 0x3c, 0x9a, 0x1e, 0xc1, 0x83, 0x98, 0xee, 0x1e, 0xcc, 0x28, 0x2c, 0x3a,
  179. 0xe9, 0x57, 0xaf, 0xea, 0xbd, 0x97, 0x2a, 0x00, 0x5d, 0xca, 0x7c, 0x54, 0x58, 0x12, 0x52, 0x8d,
  180. 0x62, 0x12, 0x0f, 0x67, 0x44, 0xb3, 0x27, 0x4c, 0x75, 0x91, 0xa7, 0xda, 0x18, 0x12, 0x2d, 0x39,
  181. 0x19, 0x0e, 0x1d, 0x31, 0x94, 0x8c, 0x36, 0xfc, 0x93, 0x0e, 0x6c, 0x5f, 0x96, 0x32, 0xbf, 0x16,
  182. 0x2d, 0x25, 0x67, 0xf8, 0x52, 0x22, 0x4b, 0x72, 0x05, 0x3d, 0x57, 0x74, 0x0f, 0x8d, 0xe4, 0x53,
  183. 0x2d, 0x58, 0x51, 0x2a, 0x86, 0x96, 0x9b, 0x36, 0xfa, 0x19, 0xfb, 0xd1, 0x41, 0x74, 0xb4, 0x99,
  184. 0xfd, 0x60, 0xc7, 0x15, 0x9a, 0xf9, 0x95, 0xec, 0x43, 0xbf, 0x11, 0xb8, 0x25, 0x4e, 0xee, 0x40,
  185. 0xd5, 0x7d, 0xb8, 0x20, 0xc3, 0xa8, 0x8e, 0xe1, 0x9f, 0x9b, 0xf6, 0x4a, 0xed, 0x71, 0x77, 0x54,
  186. 0x4c, 0x46, 0xb7, 0x8c, 0x76, 0xc9, 0x07, 0xe0, 0x5b, 0x54, 0x0f, 0x36, 0x72, 0xbe, 0xb7, 0x44,
  187. 0xe2, 0xb5, 0x5b, 0x59, 0x33, 0xe7, 0x8c, 0x48, 0x92, 0x53, 0xe8, 0xaf, 0x86, 0xad, 0xf4, 0x77,
  188. 0xe0, 0xbf, 0xd0, 0x23, 0x9a, 0x2a, 0x6a, 0x00, 0xe3, 0xcf, 0x08, 0xda, 0x3e, 0x0c, 0xda, 0x45,
  189. 0x3e, 0x45, 0x75, 0x03, 0xcd, 0x90, 0x4b, 0xf9, 0x04, 0x2b, 0xfb, 0x88, 0x77, 0xff, 0x96, 0x83,
  190. 0x7c, 0x32, 0x78, 0xfb, 0xf8, 0x7a, 0x6f, 0x74, 0x55, 0xc7, 0x2f, 0x7a, 0x71, 0x96, 0xba, 0x33,
  191. 0xa4, 0x1c, 0xb4, 0x08, 0xb6, 0xea, 0x99, 0xd4, 0x60, 0x29, 0xb2, 0x66, 0xad, 0xf1, 0x70, 0x3d,
  192. 0x59, 0xf9, 0x1c, 0x7a, 0x9f, 0xfd, 0x64, 0xef, 0x97, 0x8f, 0xae, 0xb5, 0x5e, 0x44, 0x27, 0x93,
  193. 0xa6, 0xbf, 0xe8, 0xf9, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x87, 0xd8, 0x13, 0x0a, 0x0d, 0x02,
  194. 0x00, 0x00,
  195. }