Browse Source

Update protos

master
parent
commit
23915e0054
Signed by: chris GPG Key ID: 3025DCBD46F81C0F
  1. 869
      proto/users.pb.go
  2. 62
      proto/users.proto
  3. 178
      proto/users_grpc.pb.go

869
proto/users.pb.go

@ -20,14 +20,18 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type None struct {
type UserForm struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
Password *string `protobuf:"bytes,2,opt,name=password,proto3,oneof" json:"password,omitempty"`
PasswordAgain *string `protobuf:"bytes,3,opt,name=password_again,json=passwordAgain,proto3,oneof" json:"password_again,omitempty"`
}
func (x *None) Reset() {
*x = None{}
func (x *UserForm) Reset() {
*x = UserForm{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -35,13 +39,13 @@ func (x *None) Reset() {
}
}
func (x *None) String() string {
func (x *UserForm) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*None) ProtoMessage() {}
func (*UserForm) ProtoMessage() {}
func (x *None) ProtoReflect() protoreflect.Message {
func (x *UserForm) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -53,22 +57,662 @@ func (x *None) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use None.ProtoReflect.Descriptor instead.
func (*None) Descriptor() ([]byte, []int) {
// Deprecated: Use UserForm.ProtoReflect.Descriptor instead.
func (*UserForm) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{0}
}
func (x *UserForm) GetEmail() string {
if x != nil {
return x.Email
}
return ""
}
func (x *UserForm) GetPassword() string {
if x != nil && x.Password != nil {
return *x.Password
}
return ""
}
func (x *UserForm) GetPasswordAgain() string {
if x != nil && x.PasswordAgain != nil {
return *x.PasswordAgain
}
return ""
}
type UserToken struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
Expires *int64 `protobuf:"varint,2,opt,name=expires,proto3,oneof" json:"expires,omitempty"`
}
func (x *UserToken) Reset() {
*x = UserToken{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UserToken) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserToken) ProtoMessage() {}
func (x *UserToken) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UserToken.ProtoReflect.Descriptor instead.
func (*UserToken) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{1}
}
func (x *UserToken) GetToken() string {
if x != nil {
return x.Token
}
return ""
}
func (x *UserToken) GetExpires() int64 {
if x != nil && x.Expires != nil {
return *x.Expires
}
return 0
}
type UserInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}
func (x *UserInfo) Reset() {
*x = UserInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UserInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserInfo) ProtoMessage() {}
func (x *UserInfo) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UserInfo.ProtoReflect.Descriptor instead.
func (*UserInfo) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{2}
}
func (x *UserInfo) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
type RegisterRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Form *UserForm `protobuf:"bytes,1,opt,name=form,proto3" json:"form,omitempty"`
}
func (x *RegisterRequest) Reset() {
*x = RegisterRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RegisterRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RegisterRequest) ProtoMessage() {}
func (x *RegisterRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead.
func (*RegisterRequest) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{3}
}
func (x *RegisterRequest) GetForm() *UserForm {
if x != nil {
return x.Form
}
return nil
}
type RegisterResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *RegisterResponse) Reset() {
*x = RegisterResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RegisterResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RegisterResponse) ProtoMessage() {}
func (x *RegisterResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RegisterResponse.ProtoReflect.Descriptor instead.
func (*RegisterResponse) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{4}
}
type LoginRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Form *UserForm `protobuf:"bytes,1,opt,name=form,proto3" json:"form,omitempty"`
}
func (x *LoginRequest) Reset() {
*x = LoginRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LoginRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LoginRequest) ProtoMessage() {}
func (x *LoginRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.
func (*LoginRequest) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{5}
}
func (x *LoginRequest) GetForm() *UserForm {
if x != nil {
return x.Form
}
return nil
}
type LoginResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Token *UserToken `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
}
func (x *LoginResponse) Reset() {
*x = LoginResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LoginResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LoginResponse) ProtoMessage() {}
func (x *LoginResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead.
func (*LoginResponse) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{6}
}
func (x *LoginResponse) GetToken() *UserToken {
if x != nil {
return x.Token
}
return nil
}
type AuthorizeRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Secret string `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"`
Token *UserToken `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
}
func (x *AuthorizeRequest) Reset() {
*x = AuthorizeRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AuthorizeRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthorizeRequest) ProtoMessage() {}
func (x *AuthorizeRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AuthorizeRequest.ProtoReflect.Descriptor instead.
func (*AuthorizeRequest) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{7}
}
func (x *AuthorizeRequest) GetSecret() string {
if x != nil {
return x.Secret
}
return ""
}
func (x *AuthorizeRequest) GetToken() *UserToken {
if x != nil {
return x.Token
}
return nil
}
type AuthorizeResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
User *UserInfo `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
}
func (x *AuthorizeResponse) Reset() {
*x = AuthorizeResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AuthorizeResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthorizeResponse) ProtoMessage() {}
func (x *AuthorizeResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AuthorizeResponse.ProtoReflect.Descriptor instead.
func (*AuthorizeResponse) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{8}
}
func (x *AuthorizeResponse) GetUser() *UserInfo {
if x != nil {
return x.User
}
return nil
}
type ChangePasswordRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Form *UserForm `protobuf:"bytes,1,opt,name=form,proto3" json:"form,omitempty"`
}
func (x *ChangePasswordRequest) Reset() {
*x = ChangePasswordRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ChangePasswordRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ChangePasswordRequest) ProtoMessage() {}
func (x *ChangePasswordRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ChangePasswordRequest.ProtoReflect.Descriptor instead.
func (*ChangePasswordRequest) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{9}
}
func (x *ChangePasswordRequest) GetForm() *UserForm {
if x != nil {
return x.Form
}
return nil
}
type ChangePasswordResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *ChangePasswordResponse) Reset() {
*x = ChangePasswordResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ChangePasswordResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ChangePasswordResponse) ProtoMessage() {}
func (x *ChangePasswordResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ChangePasswordResponse.ProtoReflect.Descriptor instead.
func (*ChangePasswordResponse) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{10}
}
type ResetPasswordReqeust struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Form *UserForm `protobuf:"bytes,1,opt,name=form,proto3" json:"form,omitempty"`
}
func (x *ResetPasswordReqeust) Reset() {
*x = ResetPasswordReqeust{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ResetPasswordReqeust) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ResetPasswordReqeust) ProtoMessage() {}
func (x *ResetPasswordReqeust) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ResetPasswordReqeust.ProtoReflect.Descriptor instead.
func (*ResetPasswordReqeust) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{11}
}
func (x *ResetPasswordReqeust) GetForm() *UserForm {
if x != nil {
return x.Form
}
return nil
}
type ResetPasswordResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *ResetPasswordResponse) Reset() {
*x = ResetPasswordResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ResetPasswordResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ResetPasswordResponse) ProtoMessage() {}
func (x *ResetPasswordResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ResetPasswordResponse.ProtoReflect.Descriptor instead.
func (*ResetPasswordResponse) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{12}
}
var File_proto_users_proto protoreflect.FileDescriptor
var file_proto_users_proto_rawDesc = []byte{
0x0a, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x06, 0x0a, 0x04, 0x4e, 0x6f,
0x6e, 0x65, 0x32, 0x2b, 0x0a, 0x05, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x22, 0x0a, 0x04, 0x54,
0x65, 0x73, 0x74, 0x12, 0x0b, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x4e, 0x6f, 0x6e, 0x65,
0x1a, 0x0b, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x4e, 0x6f, 0x6e, 0x65, 0x22, 0x00, 0x42,
0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x2e, 0x63, 0x68, 0x72, 0x69, 0x73, 0x68, 0x61, 0x79, 0x77,
0x61, 0x72, 0x64, 0x2e, 0x78, 0x79, 0x7a, 0x2f, 0x78, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x6f, 0x74, 0x6f, 0x12, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x8d, 0x01, 0x0a, 0x08, 0x55,
0x73, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1f, 0x0a,
0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48,
0x00, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2a,
0x0a, 0x0e, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x61, 0x67, 0x61, 0x69, 0x6e,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0d, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f,
0x72, 0x64, 0x41, 0x67, 0x61, 0x69, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70,
0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x70, 0x61, 0x73, 0x73,
0x77, 0x6f, 0x72, 0x64, 0x5f, 0x61, 0x67, 0x61, 0x69, 0x6e, 0x22, 0x4c, 0x0a, 0x09, 0x55, 0x73,
0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a,
0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00,
0x52, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08,
0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x22, 0x1a, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72,
0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
0x52, 0x02, 0x69, 0x64, 0x22, 0x36, 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x66, 0x6f, 0x72, 0x6d, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73,
0x65, 0x72, 0x46, 0x6f, 0x72, 0x6d, 0x52, 0x04, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x12, 0x0a, 0x10,
0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x22, 0x33, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x23, 0x0a, 0x04, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f,
0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x6d, 0x52,
0x04, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x37, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73,
0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x52,
0x0a, 0x10, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x26, 0x0a, 0x05, 0x74, 0x6f,
0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72,
0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b,
0x65, 0x6e, 0x22, 0x38, 0x0a, 0x11, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73,
0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x3c, 0x0a, 0x15,
0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72,
0x46, 0x6f, 0x72, 0x6d, 0x52, 0x04, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x18, 0x0a, 0x16, 0x43, 0x68,
0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73,
0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x65, 0x75, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x04,
0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x75, 0x73, 0x65,
0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x6d, 0x52, 0x04, 0x66, 0x6f, 0x72,
0x6d, 0x22, 0x17, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f,
0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xdd, 0x02, 0x0a, 0x05, 0x55,
0x73, 0x65, 0x72, 0x73, 0x12, 0x3d, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72,
0x12, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65,
0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73,
0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x13, 0x2e, 0x75,
0x73, 0x65, 0x72, 0x73, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x09, 0x41, 0x75, 0x74,
0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x41,
0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x18, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a,
0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0e, 0x43,
0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1c, 0x2e,
0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73,
0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x75, 0x73,
0x65, 0x72, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f,
0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0d,
0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1b, 0x2e,
0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77,
0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x65, 0x75, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x75, 0x73, 0x65,
0x72, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69,
0x74, 0x2e, 0x63, 0x68, 0x72, 0x69, 0x73, 0x68, 0x61, 0x79, 0x77, 0x61, 0x72, 0x64, 0x2e, 0x78,
0x79, 0x7a, 0x2f, 0x78, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -83,18 +727,45 @@ func file_proto_users_proto_rawDescGZIP() []byte {
return file_proto_users_proto_rawDescData
}
var file_proto_users_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_proto_users_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
var file_proto_users_proto_goTypes = []interface{}{
(*None)(nil), // 0: users.None
(*UserForm)(nil), // 0: users.UserForm
(*UserToken)(nil), // 1: users.UserToken
(*UserInfo)(nil), // 2: users.UserInfo
(*RegisterRequest)(nil), // 3: users.RegisterRequest
(*RegisterResponse)(nil), // 4: users.RegisterResponse
(*LoginRequest)(nil), // 5: users.LoginRequest
(*LoginResponse)(nil), // 6: users.LoginResponse
(*AuthorizeRequest)(nil), // 7: users.AuthorizeRequest
(*AuthorizeResponse)(nil), // 8: users.AuthorizeResponse
(*ChangePasswordRequest)(nil), // 9: users.ChangePasswordRequest
(*ChangePasswordResponse)(nil), // 10: users.ChangePasswordResponse
(*ResetPasswordReqeust)(nil), // 11: users.ResetPasswordReqeust
(*ResetPasswordResponse)(nil), // 12: users.ResetPasswordResponse
}
var file_proto_users_proto_depIdxs = []int32{
0, // 0: users.Users.Test:input_type -> users.None
0, // 1: users.Users.Test:output_type -> users.None
1, // [1:2] is the sub-list for method output_type
0, // [0:1] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
0, // 0: users.RegisterRequest.form:type_name -> users.UserForm
0, // 1: users.LoginRequest.form:type_name -> users.UserForm
1, // 2: users.LoginResponse.token:type_name -> users.UserToken
1, // 3: users.AuthorizeRequest.token:type_name -> users.UserToken
2, // 4: users.AuthorizeResponse.user:type_name -> users.UserInfo
0, // 5: users.ChangePasswordRequest.form:type_name -> users.UserForm
0, // 6: users.ResetPasswordReqeust.form:type_name -> users.UserForm
3, // 7: users.Users.Register:input_type -> users.RegisterRequest
5, // 8: users.Users.Login:input_type -> users.LoginRequest
7, // 9: users.Users.Authorize:input_type -> users.AuthorizeRequest
9, // 10: users.Users.ChangePassword:input_type -> users.ChangePasswordRequest
11, // 11: users.Users.ResetPassword:input_type -> users.ResetPasswordReqeust
4, // 12: users.Users.Register:output_type -> users.RegisterResponse
6, // 13: users.Users.Login:output_type -> users.LoginResponse
8, // 14: users.Users.Authorize:output_type -> users.AuthorizeResponse
10, // 15: users.Users.ChangePassword:output_type -> users.ChangePasswordResponse
12, // 16: users.Users.ResetPassword:output_type -> users.ResetPasswordResponse
12, // [12:17] is the sub-list for method output_type
7, // [7:12] is the sub-list for method input_type
7, // [7:7] is the sub-list for extension type_name
7, // [7:7] is the sub-list for extension extendee
0, // [0:7] is the sub-list for field type_name
}
func init() { file_proto_users_proto_init() }
@ -104,7 +775,151 @@ func file_proto_users_proto_init() {
}
if !protoimpl.UnsafeEnabled {
file_proto_users_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*None); i {
switch v := v.(*UserForm); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_users_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserToken); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_users_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserInfo); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_users_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RegisterRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_users_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RegisterResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_users_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LoginRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_users_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LoginResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_users_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AuthorizeRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_users_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AuthorizeResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_users_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ChangePasswordRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_users_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ChangePasswordResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_users_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ResetPasswordReqeust); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_users_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ResetPasswordResponse); i {
case 0:
return &v.state
case 1:
@ -116,13 +931,15 @@ func file_proto_users_proto_init() {
}
}
}
file_proto_users_proto_msgTypes[0].OneofWrappers = []interface{}{}
file_proto_users_proto_msgTypes[1].OneofWrappers = []interface{}{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_proto_users_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumMessages: 13,
NumExtensions: 0,
NumServices: 1,
},

62
proto/users.proto

@ -5,7 +5,65 @@ package users;
option go_package = "git.chrishayward.xyz/x/users/proto";
service Users {
rpc Test(None) returns (None) {}
rpc Register (RegisterRequest) returns (RegisterResponse) {}
rpc Login (LoginRequest) returns (LoginResponse) {}
rpc Authorize (AuthorizeRequest) returns (AuthorizeResponse) {}
rpc ChangePassword (ChangePasswordRequest) returns (ChangePasswordResponse) {}
rpc ResetPassword (ResetPasswordReqeust) returns (ResetPasswordResponse) {}
}
message None { }
message UserForm {
string email = 1;
optional string password = 2;
optional string password_again = 3;
}
message UserToken {
string token = 1;
optional int64 expires = 2;
}
message UserInfo {
int64 id = 1;
}
message RegisterRequest {
UserForm form = 1;
}
message RegisterResponse {
}
message LoginRequest {
UserForm form = 1;
}
message LoginResponse {
UserToken token = 1;
}
message AuthorizeRequest {
string secret = 1;
UserToken token = 2;
}
message AuthorizeResponse {
UserInfo user = 1;
}
message ChangePasswordRequest {
UserForm form = 1;
}
message ChangePasswordResponse {
}
message ResetPasswordReqeust {
UserForm form = 1;
}
message ResetPasswordResponse {
}

178
proto/users_grpc.pb.go

@ -19,14 +19,22 @@ import (
const _ = grpc.SupportPackageIsVersion7
const (
Users_Test_FullMethodName = "/users.Users/Test"
Users_Register_FullMethodName = "/users.Users/Register"
Users_Login_FullMethodName = "/users.Users/Login"
Users_Authorize_FullMethodName = "/users.Users/Authorize"
Users_ChangePassword_FullMethodName = "/users.Users/ChangePassword"
Users_ResetPassword_FullMethodName = "/users.Users/ResetPassword"
)
// UsersClient is the client API for Users 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 UsersClient interface {
Test(ctx context.Context, in *None, opts ...grpc.CallOption) (*None, error)
Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
Authorize(ctx context.Context, in *AuthorizeRequest, opts ...grpc.CallOption) (*AuthorizeResponse, error)
ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error)
ResetPassword(ctx context.Context, in *ResetPasswordReqeust, opts ...grpc.CallOption) (*ResetPasswordResponse, error)
}
type usersClient struct {
@ -37,9 +45,45 @@ func NewUsersClient(cc grpc.ClientConnInterface) UsersClient {
return &usersClient{cc}
}
func (c *usersClient) Test(ctx context.Context, in *None, opts ...grpc.CallOption) (*None, error) {
out := new(None)
err := c.cc.Invoke(ctx, Users_Test_FullMethodName, in, out, opts...)
func (c *usersClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) {
out := new(RegisterResponse)
err := c.cc.Invoke(ctx, Users_Register_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *usersClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) {
out := new(LoginResponse)
err := c.cc.Invoke(ctx, Users_Login_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *usersClient) Authorize(ctx context.Context, in *AuthorizeRequest, opts ...grpc.CallOption) (*AuthorizeResponse, error) {
out := new(AuthorizeResponse)
err := c.cc.Invoke(ctx, Users_Authorize_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *usersClient) ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error) {
out := new(ChangePasswordResponse)
err := c.cc.Invoke(ctx, Users_ChangePassword_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *usersClient) ResetPassword(ctx context.Context, in *ResetPasswordReqeust, opts ...grpc.CallOption) (*ResetPasswordResponse, error) {
out := new(ResetPasswordResponse)
err := c.cc.Invoke(ctx, Users_ResetPassword_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@ -50,7 +94,11 @@ func (c *usersClient) Test(ctx context.Context, in *None, opts ...grpc.CallOptio
// All implementations must embed UnimplementedUsersServer
// for forward compatibility
type UsersServer interface {
Test(context.Context, *None) (*None, error)
Register(context.Context, *RegisterRequest) (*RegisterResponse, error)
Login(context.Context, *LoginRequest) (*LoginResponse, error)
Authorize(context.Context, *AuthorizeRequest) (*AuthorizeResponse, error)
ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error)
ResetPassword(context.Context, *ResetPasswordReqeust) (*ResetPasswordResponse, error)
mustEmbedUnimplementedUsersServer()
}
@ -58,8 +106,20 @@ type UsersServer interface {
type UnimplementedUsersServer struct {
}
func (UnimplementedUsersServer) Test(context.Context, *None) (*None, error) {
return nil, status.Errorf(codes.Unimplemented, "method Test not implemented")
func (UnimplementedUsersServer) Register(context.Context, *RegisterRequest) (*RegisterResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
}
func (UnimplementedUsersServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
}
func (UnimplementedUsersServer) Authorize(context.Context, *AuthorizeRequest) (*AuthorizeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Authorize not implemented")
}
func (UnimplementedUsersServer) ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ChangePassword not implemented")
}
func (UnimplementedUsersServer) ResetPassword(context.Context, *ResetPasswordReqeust) (*ResetPasswordResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ResetPassword not implemented")
}
func (UnimplementedUsersServer) mustEmbedUnimplementedUsersServer() {}
@ -74,20 +134,92 @@ func RegisterUsersServer(s grpc.ServiceRegistrar, srv UsersServer) {
s.RegisterService(&Users_ServiceDesc, srv)
}
func _Users_Test_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(None)
func _Users_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RegisterRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UsersServer).Register(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Users_Register_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UsersServer).Register(ctx, req.(*RegisterRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Users_Login_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.(UsersServer).Login(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Users_Login_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UsersServer).Login(ctx, req.(*LoginRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Users_Authorize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AuthorizeRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UsersServer).Authorize(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Users_Authorize_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UsersServer).Authorize(ctx, req.(*AuthorizeRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Users_ChangePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ChangePasswordRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UsersServer).ChangePassword(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Users_ChangePassword_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UsersServer).ChangePassword(ctx, req.(*ChangePasswordRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Users_ResetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ResetPasswordReqeust)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UsersServer).Test(ctx, in)
return srv.(UsersServer).ResetPassword(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Users_Test_FullMethodName,
FullMethod: Users_ResetPassword_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UsersServer).Test(ctx, req.(*None))
return srv.(UsersServer).ResetPassword(ctx, req.(*ResetPasswordReqeust))
}
return interceptor(ctx, in, info, handler)
}
@ -100,8 +232,24 @@ var Users_ServiceDesc = grpc.ServiceDesc{
HandlerType: (*UsersServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Test",
Handler: _Users_Test_Handler,
MethodName: "Register",
Handler: _Users_Register_Handler,
},
{
MethodName: "Login",
Handler: _Users_Login_Handler,
},
{
MethodName: "Authorize",
Handler: _Users_Authorize_Handler,
},
{
MethodName: "ChangePassword",
Handler: _Users_ChangePassword_Handler,
},
{
MethodName: "ResetPassword",
Handler: _Users_ResetPassword_Handler,
},
},
Streams: []grpc.StreamDesc{},

Loading…
Cancel
Save