Initial commit

This commit is contained in:
Albert
2025-12-11 02:36:03 +04:00
parent 16e825a0e7
commit 2bcdfc93d6
45 changed files with 9304 additions and 78 deletions
+894
View File
@@ -0,0 +1,894 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.10
// protoc v6.33.2
// source: api/proto/auth.proto
package auth
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type SignUpRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SignUpRequest) Reset() {
*x = SignUpRequest{}
mi := &file_api_proto_auth_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SignUpRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SignUpRequest) ProtoMessage() {}
func (x *SignUpRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_auth_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SignUpRequest.ProtoReflect.Descriptor instead.
func (*SignUpRequest) Descriptor() ([]byte, []int) {
return file_api_proto_auth_proto_rawDescGZIP(), []int{0}
}
func (x *SignUpRequest) GetEmail() string {
if x != nil {
return x.Email
}
return ""
}
func (x *SignUpRequest) GetUsername() string {
if x != nil {
return x.Username
}
return ""
}
func (x *SignUpRequest) GetPassword() string {
if x != nil {
return x.Password
}
return ""
}
type SignUpResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SignUpResponse) Reset() {
*x = SignUpResponse{}
mi := &file_api_proto_auth_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SignUpResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SignUpResponse) ProtoMessage() {}
func (x *SignUpResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_auth_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SignUpResponse.ProtoReflect.Descriptor instead.
func (*SignUpResponse) Descriptor() ([]byte, []int) {
return file_api_proto_auth_proto_rawDescGZIP(), []int{1}
}
func (x *SignUpResponse) GetToken() string {
if x != nil {
return x.Token
}
return ""
}
type SignInRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SignInRequest) Reset() {
*x = SignInRequest{}
mi := &file_api_proto_auth_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SignInRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SignInRequest) ProtoMessage() {}
func (x *SignInRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_auth_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SignInRequest.ProtoReflect.Descriptor instead.
func (*SignInRequest) Descriptor() ([]byte, []int) {
return file_api_proto_auth_proto_rawDescGZIP(), []int{2}
}
func (x *SignInRequest) GetEmail() string {
if x != nil {
return x.Email
}
return ""
}
func (x *SignInRequest) GetPassword() string {
if x != nil {
return x.Password
}
return ""
}
type SignInResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SignInResponse) Reset() {
*x = SignInResponse{}
mi := &file_api_proto_auth_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SignInResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SignInResponse) ProtoMessage() {}
func (x *SignInResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_auth_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SignInResponse.ProtoReflect.Descriptor instead.
func (*SignInResponse) Descriptor() ([]byte, []int) {
return file_api_proto_auth_proto_rawDescGZIP(), []int{3}
}
func (x *SignInResponse) GetToken() string {
if x != nil {
return x.Token
}
return ""
}
type GetMeRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetMeRequest) Reset() {
*x = GetMeRequest{}
mi := &file_api_proto_auth_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetMeRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetMeRequest) ProtoMessage() {}
func (x *GetMeRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_auth_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetMeRequest.ProtoReflect.Descriptor instead.
func (*GetMeRequest) Descriptor() ([]byte, []int) {
return file_api_proto_auth_proto_rawDescGZIP(), []int{4}
}
type GetMeResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetMeResponse) Reset() {
*x = GetMeResponse{}
mi := &file_api_proto_auth_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetMeResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetMeResponse) ProtoMessage() {}
func (x *GetMeResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_auth_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetMeResponse.ProtoReflect.Descriptor instead.
func (*GetMeResponse) Descriptor() ([]byte, []int) {
return file_api_proto_auth_proto_rawDescGZIP(), []int{5}
}
func (x *GetMeResponse) GetUser() *User {
if x != nil {
return x.User
}
return nil
}
type GetUserRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetUserRequest) Reset() {
*x = GetUserRequest{}
mi := &file_api_proto_auth_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetUserRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetUserRequest) ProtoMessage() {}
func (x *GetUserRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_auth_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead.
func (*GetUserRequest) Descriptor() ([]byte, []int) {
return file_api_proto_auth_proto_rawDescGZIP(), []int{6}
}
func (x *GetUserRequest) GetUserId() string {
if x != nil {
return x.UserId
}
return ""
}
type GetUserResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetUserResponse) Reset() {
*x = GetUserResponse{}
mi := &file_api_proto_auth_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetUserResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetUserResponse) ProtoMessage() {}
func (x *GetUserResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_auth_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead.
func (*GetUserResponse) Descriptor() ([]byte, []int) {
return file_api_proto_auth_proto_rawDescGZIP(), []int{7}
}
func (x *GetUserResponse) GetUser() *User {
if x != nil {
return x.User
}
return nil
}
type GetMyStatRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetMyStatRequest) Reset() {
*x = GetMyStatRequest{}
mi := &file_api_proto_auth_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetMyStatRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetMyStatRequest) ProtoMessage() {}
func (x *GetMyStatRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_auth_proto_msgTypes[8]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetMyStatRequest.ProtoReflect.Descriptor instead.
func (*GetMyStatRequest) Descriptor() ([]byte, []int) {
return file_api_proto_auth_proto_rawDescGZIP(), []int{8}
}
type GetMyStatResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Stat *Stat `protobuf:"bytes,1,opt,name=stat,proto3" json:"stat,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetMyStatResponse) Reset() {
*x = GetMyStatResponse{}
mi := &file_api_proto_auth_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetMyStatResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetMyStatResponse) ProtoMessage() {}
func (x *GetMyStatResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_auth_proto_msgTypes[9]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetMyStatResponse.ProtoReflect.Descriptor instead.
func (*GetMyStatResponse) Descriptor() ([]byte, []int) {
return file_api_proto_auth_proto_rawDescGZIP(), []int{9}
}
func (x *GetMyStatResponse) GetStat() *Stat {
if x != nil {
return x.Stat
}
return nil
}
type GetLeaderboardRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetLeaderboardRequest) Reset() {
*x = GetLeaderboardRequest{}
mi := &file_api_proto_auth_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetLeaderboardRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetLeaderboardRequest) ProtoMessage() {}
func (x *GetLeaderboardRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_auth_proto_msgTypes[10]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetLeaderboardRequest.ProtoReflect.Descriptor instead.
func (*GetLeaderboardRequest) Descriptor() ([]byte, []int) {
return file_api_proto_auth_proto_rawDescGZIP(), []int{10}
}
type GetLeaderboardResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetLeaderboardResponse) Reset() {
*x = GetLeaderboardResponse{}
mi := &file_api_proto_auth_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetLeaderboardResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetLeaderboardResponse) ProtoMessage() {}
func (x *GetLeaderboardResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_auth_proto_msgTypes[11]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetLeaderboardResponse.ProtoReflect.Descriptor instead.
func (*GetLeaderboardResponse) Descriptor() ([]byte, []int) {
return file_api_proto_auth_proto_rawDescGZIP(), []int{11}
}
func (x *GetLeaderboardResponse) GetUsers() []*User {
if x != nil {
return x.Users
}
return nil
}
type User struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id *string `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty"`
Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"`
Avatar *string `protobuf:"bytes,4,opt,name=avatar,proto3,oneof" json:"avatar,omitempty"`
CreatedAt string `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
Achievements []*UserAchievement `protobuf:"bytes,6,rep,name=achievements,proto3" json:"achievements,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *User) Reset() {
*x = User{}
mi := &file_api_proto_auth_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *User) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*User) ProtoMessage() {}
func (x *User) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_auth_proto_msgTypes[12]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use User.ProtoReflect.Descriptor instead.
func (*User) Descriptor() ([]byte, []int) {
return file_api_proto_auth_proto_rawDescGZIP(), []int{12}
}
func (x *User) GetId() string {
if x != nil && x.Id != nil {
return *x.Id
}
return ""
}
func (x *User) GetEmail() string {
if x != nil {
return x.Email
}
return ""
}
func (x *User) GetUsername() string {
if x != nil {
return x.Username
}
return ""
}
func (x *User) GetAvatar() string {
if x != nil && x.Avatar != nil {
return *x.Avatar
}
return ""
}
func (x *User) GetCreatedAt() string {
if x != nil {
return x.CreatedAt
}
return ""
}
func (x *User) GetAchievements() []*UserAchievement {
if x != nil {
return x.Achievements
}
return nil
}
type UserAchievement struct {
state protoimpl.MessageState `protogen:"open.v1"`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
Icon string `protobuf:"bytes,3,opt,name=icon,proto3" json:"icon,omitempty"`
ReceivedAt string `protobuf:"bytes,4,opt,name=received_at,json=receivedAt,proto3" json:"received_at,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UserAchievement) Reset() {
*x = UserAchievement{}
mi := &file_api_proto_auth_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UserAchievement) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserAchievement) ProtoMessage() {}
func (x *UserAchievement) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_auth_proto_msgTypes[13]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UserAchievement.ProtoReflect.Descriptor instead.
func (*UserAchievement) Descriptor() ([]byte, []int) {
return file_api_proto_auth_proto_rawDescGZIP(), []int{13}
}
func (x *UserAchievement) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *UserAchievement) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
func (x *UserAchievement) GetIcon() string {
if x != nil {
return x.Icon
}
return ""
}
func (x *UserAchievement) GetReceivedAt() string {
if x != nil {
return x.ReceivedAt
}
return ""
}
type Stat struct {
state protoimpl.MessageState `protogen:"open.v1"`
TotalAttempts int32 `protobuf:"varint,1,opt,name=total_attempts,json=totalAttempts,proto3" json:"total_attempts,omitempty"`
SolvedTasks int32 `protobuf:"varint,2,opt,name=solved_tasks,json=solvedTasks,proto3" json:"solved_tasks,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Stat) Reset() {
*x = Stat{}
mi := &file_api_proto_auth_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Stat) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Stat) ProtoMessage() {}
func (x *Stat) ProtoReflect() protoreflect.Message {
mi := &file_api_proto_auth_proto_msgTypes[14]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Stat.ProtoReflect.Descriptor instead.
func (*Stat) Descriptor() ([]byte, []int) {
return file_api_proto_auth_proto_rawDescGZIP(), []int{14}
}
func (x *Stat) GetTotalAttempts() int32 {
if x != nil {
return x.TotalAttempts
}
return 0
}
func (x *Stat) GetSolvedTasks() int32 {
if x != nil {
return x.SolvedTasks
}
return 0
}
var File_api_proto_auth_proto protoreflect.FileDescriptor
const file_api_proto_auth_proto_rawDesc = "" +
"\n" +
"\x14api/proto/auth.proto\x12\x04auth\"]\n" +
"\rSignUpRequest\x12\x14\n" +
"\x05email\x18\x01 \x01(\tR\x05email\x12\x1a\n" +
"\busername\x18\x02 \x01(\tR\busername\x12\x1a\n" +
"\bpassword\x18\x03 \x01(\tR\bpassword\"&\n" +
"\x0eSignUpResponse\x12\x14\n" +
"\x05token\x18\x01 \x01(\tR\x05token\"A\n" +
"\rSignInRequest\x12\x14\n" +
"\x05email\x18\x01 \x01(\tR\x05email\x12\x1a\n" +
"\bpassword\x18\x02 \x01(\tR\bpassword\"&\n" +
"\x0eSignInResponse\x12\x14\n" +
"\x05token\x18\x01 \x01(\tR\x05token\"\x0e\n" +
"\fGetMeRequest\"/\n" +
"\rGetMeResponse\x12\x1e\n" +
"\x04user\x18\x01 \x01(\v2\n" +
".auth.UserR\x04user\")\n" +
"\x0eGetUserRequest\x12\x17\n" +
"\auser_id\x18\x01 \x01(\tR\x06userId\"1\n" +
"\x0fGetUserResponse\x12\x1e\n" +
"\x04user\x18\x01 \x01(\v2\n" +
".auth.UserR\x04user\"\x12\n" +
"\x10GetMyStatRequest\"3\n" +
"\x11GetMyStatResponse\x12\x1e\n" +
"\x04stat\x18\x01 \x01(\v2\n" +
".auth.StatR\x04stat\"\x17\n" +
"\x15GetLeaderboardRequest\":\n" +
"\x16GetLeaderboardResponse\x12 \n" +
"\x05users\x18\x01 \x03(\v2\n" +
".auth.UserR\x05users\"\xd6\x01\n" +
"\x04User\x12\x13\n" +
"\x02id\x18\x01 \x01(\tH\x00R\x02id\x88\x01\x01\x12\x14\n" +
"\x05email\x18\x02 \x01(\tR\x05email\x12\x1a\n" +
"\busername\x18\x03 \x01(\tR\busername\x12\x1b\n" +
"\x06avatar\x18\x04 \x01(\tH\x01R\x06avatar\x88\x01\x01\x12\x1d\n" +
"\n" +
"created_at\x18\x05 \x01(\tR\tcreatedAt\x129\n" +
"\fachievements\x18\x06 \x03(\v2\x15.auth.UserAchievementR\fachievementsB\x05\n" +
"\x03_idB\t\n" +
"\a_avatar\"|\n" +
"\x0fUserAchievement\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12 \n" +
"\vdescription\x18\x02 \x01(\tR\vdescription\x12\x12\n" +
"\x04icon\x18\x03 \x01(\tR\x04icon\x12\x1f\n" +
"\vreceived_at\x18\x04 \x01(\tR\n" +
"receivedAt\"P\n" +
"\x04Stat\x12%\n" +
"\x0etotal_attempts\x18\x01 \x01(\x05R\rtotalAttempts\x12!\n" +
"\fsolved_tasks\x18\x02 \x01(\x05R\vsolvedTasks2\xec\x02\n" +
"\vAuthService\x123\n" +
"\x06SignUp\x12\x13.auth.SignUpRequest\x1a\x14.auth.SignUpResponse\x123\n" +
"\x06SignIn\x12\x13.auth.SignInRequest\x1a\x14.auth.SignInResponse\x120\n" +
"\x05GetMe\x12\x12.auth.GetMeRequest\x1a\x13.auth.GetMeResponse\x126\n" +
"\aGetUser\x12\x14.auth.GetUserRequest\x1a\x15.auth.GetUserResponse\x12<\n" +
"\tGetMyStat\x12\x16.auth.GetMyStatRequest\x1a\x17.auth.GetMyStatResponse\x12K\n" +
"\x0eGetLeaderboard\x12\x1b.auth.GetLeaderboardRequest\x1a\x1c.auth.GetLeaderboardResponseB\x0eZ\fpkg/api/authb\x06proto3"
var (
file_api_proto_auth_proto_rawDescOnce sync.Once
file_api_proto_auth_proto_rawDescData []byte
)
func file_api_proto_auth_proto_rawDescGZIP() []byte {
file_api_proto_auth_proto_rawDescOnce.Do(func() {
file_api_proto_auth_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_api_proto_auth_proto_rawDesc), len(file_api_proto_auth_proto_rawDesc)))
})
return file_api_proto_auth_proto_rawDescData
}
var file_api_proto_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
var file_api_proto_auth_proto_goTypes = []any{
(*SignUpRequest)(nil), // 0: auth.SignUpRequest
(*SignUpResponse)(nil), // 1: auth.SignUpResponse
(*SignInRequest)(nil), // 2: auth.SignInRequest
(*SignInResponse)(nil), // 3: auth.SignInResponse
(*GetMeRequest)(nil), // 4: auth.GetMeRequest
(*GetMeResponse)(nil), // 5: auth.GetMeResponse
(*GetUserRequest)(nil), // 6: auth.GetUserRequest
(*GetUserResponse)(nil), // 7: auth.GetUserResponse
(*GetMyStatRequest)(nil), // 8: auth.GetMyStatRequest
(*GetMyStatResponse)(nil), // 9: auth.GetMyStatResponse
(*GetLeaderboardRequest)(nil), // 10: auth.GetLeaderboardRequest
(*GetLeaderboardResponse)(nil), // 11: auth.GetLeaderboardResponse
(*User)(nil), // 12: auth.User
(*UserAchievement)(nil), // 13: auth.UserAchievement
(*Stat)(nil), // 14: auth.Stat
}
var file_api_proto_auth_proto_depIdxs = []int32{
12, // 0: auth.GetMeResponse.user:type_name -> auth.User
12, // 1: auth.GetUserResponse.user:type_name -> auth.User
14, // 2: auth.GetMyStatResponse.stat:type_name -> auth.Stat
12, // 3: auth.GetLeaderboardResponse.users:type_name -> auth.User
13, // 4: auth.User.achievements:type_name -> auth.UserAchievement
0, // 5: auth.AuthService.SignUp:input_type -> auth.SignUpRequest
2, // 6: auth.AuthService.SignIn:input_type -> auth.SignInRequest
4, // 7: auth.AuthService.GetMe:input_type -> auth.GetMeRequest
6, // 8: auth.AuthService.GetUser:input_type -> auth.GetUserRequest
8, // 9: auth.AuthService.GetMyStat:input_type -> auth.GetMyStatRequest
10, // 10: auth.AuthService.GetLeaderboard:input_type -> auth.GetLeaderboardRequest
1, // 11: auth.AuthService.SignUp:output_type -> auth.SignUpResponse
3, // 12: auth.AuthService.SignIn:output_type -> auth.SignInResponse
5, // 13: auth.AuthService.GetMe:output_type -> auth.GetMeResponse
7, // 14: auth.AuthService.GetUser:output_type -> auth.GetUserResponse
9, // 15: auth.AuthService.GetMyStat:output_type -> auth.GetMyStatResponse
11, // 16: auth.AuthService.GetLeaderboard:output_type -> auth.GetLeaderboardResponse
11, // [11:17] is the sub-list for method output_type
5, // [5:11] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
5, // [5:5] is the sub-list for extension extendee
0, // [0:5] is the sub-list for field type_name
}
func init() { file_api_proto_auth_proto_init() }
func file_api_proto_auth_proto_init() {
if File_api_proto_auth_proto != nil {
return
}
file_api_proto_auth_proto_msgTypes[12].OneofWrappers = []any{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_proto_auth_proto_rawDesc), len(file_api_proto_auth_proto_rawDesc)),
NumEnums: 0,
NumMessages: 15,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_api_proto_auth_proto_goTypes,
DependencyIndexes: file_api_proto_auth_proto_depIdxs,
MessageInfos: file_api_proto_auth_proto_msgTypes,
}.Build()
File_api_proto_auth_proto = out.File
file_api_proto_auth_proto_goTypes = nil
file_api_proto_auth_proto_depIdxs = nil
}
+311
View File
@@ -0,0 +1,311 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v6.33.2
// source: api/proto/auth.proto
package auth
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
AuthService_SignUp_FullMethodName = "/auth.AuthService/SignUp"
AuthService_SignIn_FullMethodName = "/auth.AuthService/SignIn"
AuthService_GetMe_FullMethodName = "/auth.AuthService/GetMe"
AuthService_GetUser_FullMethodName = "/auth.AuthService/GetUser"
AuthService_GetMyStat_FullMethodName = "/auth.AuthService/GetMyStat"
AuthService_GetLeaderboard_FullMethodName = "/auth.AuthService/GetLeaderboard"
)
// AuthServiceClient is the client API for AuthService 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 AuthServiceClient interface {
SignUp(ctx context.Context, in *SignUpRequest, opts ...grpc.CallOption) (*SignUpResponse, error)
SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*SignInResponse, error)
GetMe(ctx context.Context, in *GetMeRequest, opts ...grpc.CallOption) (*GetMeResponse, error)
GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error)
GetMyStat(ctx context.Context, in *GetMyStatRequest, opts ...grpc.CallOption) (*GetMyStatResponse, error)
GetLeaderboard(ctx context.Context, in *GetLeaderboardRequest, opts ...grpc.CallOption) (*GetLeaderboardResponse, error)
}
type authServiceClient struct {
cc grpc.ClientConnInterface
}
func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient {
return &authServiceClient{cc}
}
func (c *authServiceClient) SignUp(ctx context.Context, in *SignUpRequest, opts ...grpc.CallOption) (*SignUpResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SignUpResponse)
err := c.cc.Invoke(ctx, AuthService_SignUp_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authServiceClient) SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*SignInResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SignInResponse)
err := c.cc.Invoke(ctx, AuthService_SignIn_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authServiceClient) GetMe(ctx context.Context, in *GetMeRequest, opts ...grpc.CallOption) (*GetMeResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetMeResponse)
err := c.cc.Invoke(ctx, AuthService_GetMe_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetUserResponse)
err := c.cc.Invoke(ctx, AuthService_GetUser_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authServiceClient) GetMyStat(ctx context.Context, in *GetMyStatRequest, opts ...grpc.CallOption) (*GetMyStatResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetMyStatResponse)
err := c.cc.Invoke(ctx, AuthService_GetMyStat_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authServiceClient) GetLeaderboard(ctx context.Context, in *GetLeaderboardRequest, opts ...grpc.CallOption) (*GetLeaderboardResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetLeaderboardResponse)
err := c.cc.Invoke(ctx, AuthService_GetLeaderboard_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// AuthServiceServer is the server API for AuthService service.
// All implementations must embed UnimplementedAuthServiceServer
// for forward compatibility.
type AuthServiceServer interface {
SignUp(context.Context, *SignUpRequest) (*SignUpResponse, error)
SignIn(context.Context, *SignInRequest) (*SignInResponse, error)
GetMe(context.Context, *GetMeRequest) (*GetMeResponse, error)
GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
GetMyStat(context.Context, *GetMyStatRequest) (*GetMyStatResponse, error)
GetLeaderboard(context.Context, *GetLeaderboardRequest) (*GetLeaderboardResponse, error)
mustEmbedUnimplementedAuthServiceServer()
}
// UnimplementedAuthServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedAuthServiceServer struct{}
func (UnimplementedAuthServiceServer) SignUp(context.Context, *SignUpRequest) (*SignUpResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SignUp not implemented")
}
func (UnimplementedAuthServiceServer) SignIn(context.Context, *SignInRequest) (*SignInResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SignIn not implemented")
}
func (UnimplementedAuthServiceServer) GetMe(context.Context, *GetMeRequest) (*GetMeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetMe not implemented")
}
func (UnimplementedAuthServiceServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented")
}
func (UnimplementedAuthServiceServer) GetMyStat(context.Context, *GetMyStatRequest) (*GetMyStatResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetMyStat not implemented")
}
func (UnimplementedAuthServiceServer) GetLeaderboard(context.Context, *GetLeaderboardRequest) (*GetLeaderboardResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetLeaderboard not implemented")
}
func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
func (UnimplementedAuthServiceServer) testEmbeddedByValue() {}
// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AuthServiceServer will
// result in compilation errors.
type UnsafeAuthServiceServer interface {
mustEmbedUnimplementedAuthServiceServer()
}
func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) {
// If the following call pancis, it indicates UnimplementedAuthServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&AuthService_ServiceDesc, srv)
}
func _AuthService_SignUp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SignUpRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).SignUp(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AuthService_SignUp_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).SignUp(ctx, req.(*SignUpRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AuthService_SignIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SignInRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).SignIn(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AuthService_SignIn_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).SignIn(ctx, req.(*SignInRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AuthService_GetMe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetMeRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).GetMe(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AuthService_GetMe_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).GetMe(ctx, req.(*GetMeRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AuthService_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).GetUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AuthService_GetUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).GetUser(ctx, req.(*GetUserRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AuthService_GetMyStat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetMyStatRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).GetMyStat(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AuthService_GetMyStat_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).GetMyStat(ctx, req.(*GetMyStatRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AuthService_GetLeaderboard_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetLeaderboardRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).GetLeaderboard(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AuthService_GetLeaderboard_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).GetLeaderboard(ctx, req.(*GetLeaderboardRequest))
}
return interceptor(ctx, in, info, handler)
}
// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AuthService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "auth.AuthService",
HandlerType: (*AuthServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "SignUp",
Handler: _AuthService_SignUp_Handler,
},
{
MethodName: "SignIn",
Handler: _AuthService_SignIn_Handler,
},
{
MethodName: "GetMe",
Handler: _AuthService_GetMe_Handler,
},
{
MethodName: "GetUser",
Handler: _AuthService_GetUser_Handler,
},
{
MethodName: "GetMyStat",
Handler: _AuthService_GetMyStat_Handler,
},
{
MethodName: "GetLeaderboard",
Handler: _AuthService_GetLeaderboard_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/proto/auth.proto",
}