Initial commit
This commit is contained in:
@@ -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
|
||||
}
|
||||
@@ -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",
|
||||
}
|
||||
@@ -0,0 +1,566 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.10
|
||||
// protoc v6.33.2
|
||||
// source: api/proto/competition.proto
|
||||
|
||||
package competition
|
||||
|
||||
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 CompetitionState int32
|
||||
|
||||
const (
|
||||
CompetitionState_COMPETITION_STATE_UNSPECIFIED CompetitionState = 0
|
||||
CompetitionState_COMPETITION_STATE_NOT_STARTED CompetitionState = 1
|
||||
CompetitionState_COMPETITION_STATE_STARTED CompetitionState = 2
|
||||
CompetitionState_COMPETITION_STATE_FINISHED CompetitionState = 3
|
||||
)
|
||||
|
||||
// Enum value maps for CompetitionState.
|
||||
var (
|
||||
CompetitionState_name = map[int32]string{
|
||||
0: "COMPETITION_STATE_UNSPECIFIED",
|
||||
1: "COMPETITION_STATE_NOT_STARTED",
|
||||
2: "COMPETITION_STATE_STARTED",
|
||||
3: "COMPETITION_STATE_FINISHED",
|
||||
}
|
||||
CompetitionState_value = map[string]int32{
|
||||
"COMPETITION_STATE_UNSPECIFIED": 0,
|
||||
"COMPETITION_STATE_NOT_STARTED": 1,
|
||||
"COMPETITION_STATE_STARTED": 2,
|
||||
"COMPETITION_STATE_FINISHED": 3,
|
||||
}
|
||||
)
|
||||
|
||||
func (x CompetitionState) Enum() *CompetitionState {
|
||||
p := new(CompetitionState)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x CompetitionState) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (CompetitionState) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_api_proto_competition_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (CompetitionState) Type() protoreflect.EnumType {
|
||||
return &file_api_proto_competition_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x CompetitionState) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CompetitionState.Descriptor instead.
|
||||
func (CompetitionState) EnumDescriptor() ([]byte, []int) {
|
||||
return file_api_proto_competition_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type GetCompetitionRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
CompetitionId string `protobuf:"bytes,1,opt,name=competition_id,json=competitionId,proto3" json:"competition_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetCompetitionRequest) Reset() {
|
||||
*x = GetCompetitionRequest{}
|
||||
mi := &file_api_proto_competition_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetCompetitionRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetCompetitionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetCompetitionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_competition_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 GetCompetitionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetCompetitionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_competition_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *GetCompetitionRequest) GetCompetitionId() string {
|
||||
if x != nil {
|
||||
return x.CompetitionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetCompetitionResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Competition *Competition `protobuf:"bytes,1,opt,name=competition,proto3" json:"competition,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetCompetitionResponse) Reset() {
|
||||
*x = GetCompetitionResponse{}
|
||||
mi := &file_api_proto_competition_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetCompetitionResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetCompetitionResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetCompetitionResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_competition_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 GetCompetitionResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetCompetitionResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_competition_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GetCompetitionResponse) GetCompetition() *Competition {
|
||||
if x != nil {
|
||||
return x.Competition
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ListCompetitionsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
IsParticipating bool `protobuf:"varint,1,opt,name=is_participating,json=isParticipating,proto3" json:"is_participating,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListCompetitionsRequest) Reset() {
|
||||
*x = ListCompetitionsRequest{}
|
||||
mi := &file_api_proto_competition_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListCompetitionsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListCompetitionsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ListCompetitionsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_competition_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 ListCompetitionsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListCompetitionsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_competition_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *ListCompetitionsRequest) GetIsParticipating() bool {
|
||||
if x != nil {
|
||||
return x.IsParticipating
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type ListCompetitionsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Competitions []*Competition `protobuf:"bytes,1,rep,name=competitions,proto3" json:"competitions,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListCompetitionsResponse) Reset() {
|
||||
*x = ListCompetitionsResponse{}
|
||||
mi := &file_api_proto_competition_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListCompetitionsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListCompetitionsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListCompetitionsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_competition_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 ListCompetitionsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListCompetitionsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_competition_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *ListCompetitionsResponse) GetCompetitions() []*Competition {
|
||||
if x != nil {
|
||||
return x.Competitions
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ChangeCompetitionStateRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
CompetitionId string `protobuf:"bytes,1,opt,name=competition_id,json=competitionId,proto3" json:"competition_id,omitempty"`
|
||||
State CompetitionState `protobuf:"varint,2,opt,name=state,proto3,enum=competition.CompetitionState" json:"state,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ChangeCompetitionStateRequest) Reset() {
|
||||
*x = ChangeCompetitionStateRequest{}
|
||||
mi := &file_api_proto_competition_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ChangeCompetitionStateRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ChangeCompetitionStateRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ChangeCompetitionStateRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_competition_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 ChangeCompetitionStateRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ChangeCompetitionStateRequest) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_competition_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *ChangeCompetitionStateRequest) GetCompetitionId() string {
|
||||
if x != nil {
|
||||
return x.CompetitionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ChangeCompetitionStateRequest) GetState() CompetitionState {
|
||||
if x != nil {
|
||||
return x.State
|
||||
}
|
||||
return CompetitionState_COMPETITION_STATE_UNSPECIFIED
|
||||
}
|
||||
|
||||
type ChangeCompetitionStateResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
State CompetitionState `protobuf:"varint,1,opt,name=state,proto3,enum=competition.CompetitionState" json:"state,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ChangeCompetitionStateResponse) Reset() {
|
||||
*x = ChangeCompetitionStateResponse{}
|
||||
mi := &file_api_proto_competition_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ChangeCompetitionStateResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ChangeCompetitionStateResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ChangeCompetitionStateResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_competition_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 ChangeCompetitionStateResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ChangeCompetitionStateResponse) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_competition_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *ChangeCompetitionStateResponse) GetState() CompetitionState {
|
||||
if x != nil {
|
||||
return x.State
|
||||
}
|
||||
return CompetitionState_COMPETITION_STATE_UNSPECIFIED
|
||||
}
|
||||
|
||||
type Competition struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
State CompetitionState `protobuf:"varint,2,opt,name=state,proto3,enum=competition.CompetitionState" json:"state,omitempty"`
|
||||
Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
|
||||
Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
|
||||
ImageUrl *string `protobuf:"bytes,5,opt,name=image_url,json=imageUrl,proto3,oneof" json:"image_url,omitempty"`
|
||||
EndDate *string `protobuf:"bytes,6,opt,name=end_date,json=endDate,proto3,oneof" json:"end_date,omitempty"`
|
||||
StartDate *string `protobuf:"bytes,7,opt,name=start_date,json=startDate,proto3,oneof" json:"start_date,omitempty"`
|
||||
Type string `protobuf:"bytes,8,opt,name=type,proto3" json:"type,omitempty"`
|
||||
ParticipationType string `protobuf:"bytes,9,opt,name=participation_type,json=participationType,proto3" json:"participation_type,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Competition) Reset() {
|
||||
*x = Competition{}
|
||||
mi := &file_api_proto_competition_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Competition) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Competition) ProtoMessage() {}
|
||||
|
||||
func (x *Competition) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_proto_competition_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 Competition.ProtoReflect.Descriptor instead.
|
||||
func (*Competition) Descriptor() ([]byte, []int) {
|
||||
return file_api_proto_competition_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *Competition) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Competition) GetState() CompetitionState {
|
||||
if x != nil {
|
||||
return x.State
|
||||
}
|
||||
return CompetitionState_COMPETITION_STATE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *Competition) GetTitle() string {
|
||||
if x != nil {
|
||||
return x.Title
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Competition) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Competition) GetImageUrl() string {
|
||||
if x != nil && x.ImageUrl != nil {
|
||||
return *x.ImageUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Competition) GetEndDate() string {
|
||||
if x != nil && x.EndDate != nil {
|
||||
return *x.EndDate
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Competition) GetStartDate() string {
|
||||
if x != nil && x.StartDate != nil {
|
||||
return *x.StartDate
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Competition) GetType() string {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Competition) GetParticipationType() string {
|
||||
if x != nil {
|
||||
return x.ParticipationType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_api_proto_competition_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_api_proto_competition_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x1bapi/proto/competition.proto\x12\vcompetition\">\n" +
|
||||
"\x15GetCompetitionRequest\x12%\n" +
|
||||
"\x0ecompetition_id\x18\x01 \x01(\tR\rcompetitionId\"T\n" +
|
||||
"\x16GetCompetitionResponse\x12:\n" +
|
||||
"\vcompetition\x18\x01 \x01(\v2\x18.competition.CompetitionR\vcompetition\"D\n" +
|
||||
"\x17ListCompetitionsRequest\x12)\n" +
|
||||
"\x10is_participating\x18\x01 \x01(\bR\x0fisParticipating\"X\n" +
|
||||
"\x18ListCompetitionsResponse\x12<\n" +
|
||||
"\fcompetitions\x18\x01 \x03(\v2\x18.competition.CompetitionR\fcompetitions\"{\n" +
|
||||
"\x1dChangeCompetitionStateRequest\x12%\n" +
|
||||
"\x0ecompetition_id\x18\x01 \x01(\tR\rcompetitionId\x123\n" +
|
||||
"\x05state\x18\x02 \x01(\x0e2\x1d.competition.CompetitionStateR\x05state\"U\n" +
|
||||
"\x1eChangeCompetitionStateResponse\x123\n" +
|
||||
"\x05state\x18\x01 \x01(\x0e2\x1d.competition.CompetitionStateR\x05state\"\xdd\x02\n" +
|
||||
"\vCompetition\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x123\n" +
|
||||
"\x05state\x18\x02 \x01(\x0e2\x1d.competition.CompetitionStateR\x05state\x12\x14\n" +
|
||||
"\x05title\x18\x03 \x01(\tR\x05title\x12 \n" +
|
||||
"\vdescription\x18\x04 \x01(\tR\vdescription\x12 \n" +
|
||||
"\timage_url\x18\x05 \x01(\tH\x00R\bimageUrl\x88\x01\x01\x12\x1e\n" +
|
||||
"\bend_date\x18\x06 \x01(\tH\x01R\aendDate\x88\x01\x01\x12\"\n" +
|
||||
"\n" +
|
||||
"start_date\x18\a \x01(\tH\x02R\tstartDate\x88\x01\x01\x12\x12\n" +
|
||||
"\x04type\x18\b \x01(\tR\x04type\x12-\n" +
|
||||
"\x12participation_type\x18\t \x01(\tR\x11participationTypeB\f\n" +
|
||||
"\n" +
|
||||
"_image_urlB\v\n" +
|
||||
"\t_end_dateB\r\n" +
|
||||
"\v_start_date*\x97\x01\n" +
|
||||
"\x10CompetitionState\x12!\n" +
|
||||
"\x1dCOMPETITION_STATE_UNSPECIFIED\x10\x00\x12!\n" +
|
||||
"\x1dCOMPETITION_STATE_NOT_STARTED\x10\x01\x12\x1d\n" +
|
||||
"\x19COMPETITION_STATE_STARTED\x10\x02\x12\x1e\n" +
|
||||
"\x1aCOMPETITION_STATE_FINISHED\x10\x032\xc3\x02\n" +
|
||||
"\x12CompetitionService\x12Y\n" +
|
||||
"\x0eGetCompetition\x12\".competition.GetCompetitionRequest\x1a#.competition.GetCompetitionResponse\x12_\n" +
|
||||
"\x10ListCompetitions\x12$.competition.ListCompetitionsRequest\x1a%.competition.ListCompetitionsResponse\x12q\n" +
|
||||
"\x16ChangeCompetitionState\x12*.competition.ChangeCompetitionStateRequest\x1a+.competition.ChangeCompetitionStateResponseB\x15Z\x13pkg/api/competitionb\x06proto3"
|
||||
|
||||
var (
|
||||
file_api_proto_competition_proto_rawDescOnce sync.Once
|
||||
file_api_proto_competition_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_api_proto_competition_proto_rawDescGZIP() []byte {
|
||||
file_api_proto_competition_proto_rawDescOnce.Do(func() {
|
||||
file_api_proto_competition_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_api_proto_competition_proto_rawDesc), len(file_api_proto_competition_proto_rawDesc)))
|
||||
})
|
||||
return file_api_proto_competition_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_api_proto_competition_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_api_proto_competition_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_api_proto_competition_proto_goTypes = []any{
|
||||
(CompetitionState)(0), // 0: competition.CompetitionState
|
||||
(*GetCompetitionRequest)(nil), // 1: competition.GetCompetitionRequest
|
||||
(*GetCompetitionResponse)(nil), // 2: competition.GetCompetitionResponse
|
||||
(*ListCompetitionsRequest)(nil), // 3: competition.ListCompetitionsRequest
|
||||
(*ListCompetitionsResponse)(nil), // 4: competition.ListCompetitionsResponse
|
||||
(*ChangeCompetitionStateRequest)(nil), // 5: competition.ChangeCompetitionStateRequest
|
||||
(*ChangeCompetitionStateResponse)(nil), // 6: competition.ChangeCompetitionStateResponse
|
||||
(*Competition)(nil), // 7: competition.Competition
|
||||
}
|
||||
var file_api_proto_competition_proto_depIdxs = []int32{
|
||||
7, // 0: competition.GetCompetitionResponse.competition:type_name -> competition.Competition
|
||||
7, // 1: competition.ListCompetitionsResponse.competitions:type_name -> competition.Competition
|
||||
0, // 2: competition.ChangeCompetitionStateRequest.state:type_name -> competition.CompetitionState
|
||||
0, // 3: competition.ChangeCompetitionStateResponse.state:type_name -> competition.CompetitionState
|
||||
0, // 4: competition.Competition.state:type_name -> competition.CompetitionState
|
||||
1, // 5: competition.CompetitionService.GetCompetition:input_type -> competition.GetCompetitionRequest
|
||||
3, // 6: competition.CompetitionService.ListCompetitions:input_type -> competition.ListCompetitionsRequest
|
||||
5, // 7: competition.CompetitionService.ChangeCompetitionState:input_type -> competition.ChangeCompetitionStateRequest
|
||||
2, // 8: competition.CompetitionService.GetCompetition:output_type -> competition.GetCompetitionResponse
|
||||
4, // 9: competition.CompetitionService.ListCompetitions:output_type -> competition.ListCompetitionsResponse
|
||||
6, // 10: competition.CompetitionService.ChangeCompetitionState:output_type -> competition.ChangeCompetitionStateResponse
|
||||
8, // [8:11] is the sub-list for method output_type
|
||||
5, // [5:8] 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_competition_proto_init() }
|
||||
func file_api_proto_competition_proto_init() {
|
||||
if File_api_proto_competition_proto != nil {
|
||||
return
|
||||
}
|
||||
file_api_proto_competition_proto_msgTypes[6].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_proto_competition_proto_rawDesc), len(file_api_proto_competition_proto_rawDesc)),
|
||||
NumEnums: 1,
|
||||
NumMessages: 7,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_api_proto_competition_proto_goTypes,
|
||||
DependencyIndexes: file_api_proto_competition_proto_depIdxs,
|
||||
EnumInfos: file_api_proto_competition_proto_enumTypes,
|
||||
MessageInfos: file_api_proto_competition_proto_msgTypes,
|
||||
}.Build()
|
||||
File_api_proto_competition_proto = out.File
|
||||
file_api_proto_competition_proto_goTypes = nil
|
||||
file_api_proto_competition_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
// 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/competition.proto
|
||||
|
||||
package competition
|
||||
|
||||
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 (
|
||||
CompetitionService_GetCompetition_FullMethodName = "/competition.CompetitionService/GetCompetition"
|
||||
CompetitionService_ListCompetitions_FullMethodName = "/competition.CompetitionService/ListCompetitions"
|
||||
CompetitionService_ChangeCompetitionState_FullMethodName = "/competition.CompetitionService/ChangeCompetitionState"
|
||||
)
|
||||
|
||||
// CompetitionServiceClient is the client API for CompetitionService 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 CompetitionServiceClient interface {
|
||||
GetCompetition(ctx context.Context, in *GetCompetitionRequest, opts ...grpc.CallOption) (*GetCompetitionResponse, error)
|
||||
ListCompetitions(ctx context.Context, in *ListCompetitionsRequest, opts ...grpc.CallOption) (*ListCompetitionsResponse, error)
|
||||
ChangeCompetitionState(ctx context.Context, in *ChangeCompetitionStateRequest, opts ...grpc.CallOption) (*ChangeCompetitionStateResponse, error)
|
||||
}
|
||||
|
||||
type competitionServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewCompetitionServiceClient(cc grpc.ClientConnInterface) CompetitionServiceClient {
|
||||
return &competitionServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *competitionServiceClient) GetCompetition(ctx context.Context, in *GetCompetitionRequest, opts ...grpc.CallOption) (*GetCompetitionResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetCompetitionResponse)
|
||||
err := c.cc.Invoke(ctx, CompetitionService_GetCompetition_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *competitionServiceClient) ListCompetitions(ctx context.Context, in *ListCompetitionsRequest, opts ...grpc.CallOption) (*ListCompetitionsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListCompetitionsResponse)
|
||||
err := c.cc.Invoke(ctx, CompetitionService_ListCompetitions_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *competitionServiceClient) ChangeCompetitionState(ctx context.Context, in *ChangeCompetitionStateRequest, opts ...grpc.CallOption) (*ChangeCompetitionStateResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ChangeCompetitionStateResponse)
|
||||
err := c.cc.Invoke(ctx, CompetitionService_ChangeCompetitionState_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// CompetitionServiceServer is the server API for CompetitionService service.
|
||||
// All implementations must embed UnimplementedCompetitionServiceServer
|
||||
// for forward compatibility.
|
||||
type CompetitionServiceServer interface {
|
||||
GetCompetition(context.Context, *GetCompetitionRequest) (*GetCompetitionResponse, error)
|
||||
ListCompetitions(context.Context, *ListCompetitionsRequest) (*ListCompetitionsResponse, error)
|
||||
ChangeCompetitionState(context.Context, *ChangeCompetitionStateRequest) (*ChangeCompetitionStateResponse, error)
|
||||
mustEmbedUnimplementedCompetitionServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedCompetitionServiceServer 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 UnimplementedCompetitionServiceServer struct{}
|
||||
|
||||
func (UnimplementedCompetitionServiceServer) GetCompetition(context.Context, *GetCompetitionRequest) (*GetCompetitionResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetCompetition not implemented")
|
||||
}
|
||||
func (UnimplementedCompetitionServiceServer) ListCompetitions(context.Context, *ListCompetitionsRequest) (*ListCompetitionsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListCompetitions not implemented")
|
||||
}
|
||||
func (UnimplementedCompetitionServiceServer) ChangeCompetitionState(context.Context, *ChangeCompetitionStateRequest) (*ChangeCompetitionStateResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ChangeCompetitionState not implemented")
|
||||
}
|
||||
func (UnimplementedCompetitionServiceServer) mustEmbedUnimplementedCompetitionServiceServer() {}
|
||||
func (UnimplementedCompetitionServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeCompetitionServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to CompetitionServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeCompetitionServiceServer interface {
|
||||
mustEmbedUnimplementedCompetitionServiceServer()
|
||||
}
|
||||
|
||||
func RegisterCompetitionServiceServer(s grpc.ServiceRegistrar, srv CompetitionServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedCompetitionServiceServer 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(&CompetitionService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _CompetitionService_GetCompetition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetCompetitionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(CompetitionServiceServer).GetCompetition(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: CompetitionService_GetCompetition_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CompetitionServiceServer).GetCompetition(ctx, req.(*GetCompetitionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _CompetitionService_ListCompetitions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListCompetitionsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(CompetitionServiceServer).ListCompetitions(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: CompetitionService_ListCompetitions_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CompetitionServiceServer).ListCompetitions(ctx, req.(*ListCompetitionsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _CompetitionService_ChangeCompetitionState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ChangeCompetitionStateRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(CompetitionServiceServer).ChangeCompetitionState(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: CompetitionService_ChangeCompetitionState_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CompetitionServiceServer).ChangeCompetitionState(ctx, req.(*ChangeCompetitionStateRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// CompetitionService_ServiceDesc is the grpc.ServiceDesc for CompetitionService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var CompetitionService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "competition.CompetitionService",
|
||||
HandlerType: (*CompetitionServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetCompetition",
|
||||
Handler: _CompetitionService_GetCompetition_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListCompetitions",
|
||||
Handler: _CompetitionService_ListCompetitions_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ChangeCompetitionState",
|
||||
Handler: _CompetitionService_ChangeCompetitionState_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "api/proto/competition.proto",
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,349 @@
|
||||
// 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/task.proto
|
||||
|
||||
package task
|
||||
|
||||
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 (
|
||||
TaskService_StartCompetition_FullMethodName = "/task.TaskService/StartCompetition"
|
||||
TaskService_GetCompetitionTasks_FullMethodName = "/task.TaskService/GetCompetitionTasks"
|
||||
TaskService_GetTask_FullMethodName = "/task.TaskService/GetTask"
|
||||
TaskService_SubmitTask_FullMethodName = "/task.TaskService/SubmitTask"
|
||||
TaskService_GetSubmissionsHistory_FullMethodName = "/task.TaskService/GetSubmissionsHistory"
|
||||
TaskService_GetTaskAttachments_FullMethodName = "/task.TaskService/GetTaskAttachments"
|
||||
TaskService_GetCompetitionResults_FullMethodName = "/task.TaskService/GetCompetitionResults"
|
||||
)
|
||||
|
||||
// TaskServiceClient is the client API for TaskService 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 TaskServiceClient interface {
|
||||
StartCompetition(ctx context.Context, in *StartCompetitionRequest, opts ...grpc.CallOption) (*StartCompetitionResponse, error)
|
||||
GetCompetitionTasks(ctx context.Context, in *GetCompetitionTasksRequest, opts ...grpc.CallOption) (*GetCompetitionTasksResponse, error)
|
||||
GetTask(ctx context.Context, in *GetTaskRequest, opts ...grpc.CallOption) (*GetTaskResponse, error)
|
||||
SubmitTask(ctx context.Context, in *SubmitTaskRequest, opts ...grpc.CallOption) (*SubmitTaskResponse, error)
|
||||
GetSubmissionsHistory(ctx context.Context, in *GetSubmissionsHistoryRequest, opts ...grpc.CallOption) (*GetSubmissionsHistoryResponse, error)
|
||||
GetTaskAttachments(ctx context.Context, in *GetTaskAttachmentsRequest, opts ...grpc.CallOption) (*GetTaskAttachmentsResponse, error)
|
||||
GetCompetitionResults(ctx context.Context, in *GetCompetitionResultsRequest, opts ...grpc.CallOption) (*GetCompetitionResultsResponse, error)
|
||||
}
|
||||
|
||||
type taskServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewTaskServiceClient(cc grpc.ClientConnInterface) TaskServiceClient {
|
||||
return &taskServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *taskServiceClient) StartCompetition(ctx context.Context, in *StartCompetitionRequest, opts ...grpc.CallOption) (*StartCompetitionResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StartCompetitionResponse)
|
||||
err := c.cc.Invoke(ctx, TaskService_StartCompetition_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskServiceClient) GetCompetitionTasks(ctx context.Context, in *GetCompetitionTasksRequest, opts ...grpc.CallOption) (*GetCompetitionTasksResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetCompetitionTasksResponse)
|
||||
err := c.cc.Invoke(ctx, TaskService_GetCompetitionTasks_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskServiceClient) GetTask(ctx context.Context, in *GetTaskRequest, opts ...grpc.CallOption) (*GetTaskResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetTaskResponse)
|
||||
err := c.cc.Invoke(ctx, TaskService_GetTask_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskServiceClient) SubmitTask(ctx context.Context, in *SubmitTaskRequest, opts ...grpc.CallOption) (*SubmitTaskResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SubmitTaskResponse)
|
||||
err := c.cc.Invoke(ctx, TaskService_SubmitTask_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskServiceClient) GetSubmissionsHistory(ctx context.Context, in *GetSubmissionsHistoryRequest, opts ...grpc.CallOption) (*GetSubmissionsHistoryResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetSubmissionsHistoryResponse)
|
||||
err := c.cc.Invoke(ctx, TaskService_GetSubmissionsHistory_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskServiceClient) GetTaskAttachments(ctx context.Context, in *GetTaskAttachmentsRequest, opts ...grpc.CallOption) (*GetTaskAttachmentsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetTaskAttachmentsResponse)
|
||||
err := c.cc.Invoke(ctx, TaskService_GetTaskAttachments_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskServiceClient) GetCompetitionResults(ctx context.Context, in *GetCompetitionResultsRequest, opts ...grpc.CallOption) (*GetCompetitionResultsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetCompetitionResultsResponse)
|
||||
err := c.cc.Invoke(ctx, TaskService_GetCompetitionResults_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// TaskServiceServer is the server API for TaskService service.
|
||||
// All implementations must embed UnimplementedTaskServiceServer
|
||||
// for forward compatibility.
|
||||
type TaskServiceServer interface {
|
||||
StartCompetition(context.Context, *StartCompetitionRequest) (*StartCompetitionResponse, error)
|
||||
GetCompetitionTasks(context.Context, *GetCompetitionTasksRequest) (*GetCompetitionTasksResponse, error)
|
||||
GetTask(context.Context, *GetTaskRequest) (*GetTaskResponse, error)
|
||||
SubmitTask(context.Context, *SubmitTaskRequest) (*SubmitTaskResponse, error)
|
||||
GetSubmissionsHistory(context.Context, *GetSubmissionsHistoryRequest) (*GetSubmissionsHistoryResponse, error)
|
||||
GetTaskAttachments(context.Context, *GetTaskAttachmentsRequest) (*GetTaskAttachmentsResponse, error)
|
||||
GetCompetitionResults(context.Context, *GetCompetitionResultsRequest) (*GetCompetitionResultsResponse, error)
|
||||
mustEmbedUnimplementedTaskServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedTaskServiceServer 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 UnimplementedTaskServiceServer struct{}
|
||||
|
||||
func (UnimplementedTaskServiceServer) StartCompetition(context.Context, *StartCompetitionRequest) (*StartCompetitionResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method StartCompetition not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) GetCompetitionTasks(context.Context, *GetCompetitionTasksRequest) (*GetCompetitionTasksResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetCompetitionTasks not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) GetTask(context.Context, *GetTaskRequest) (*GetTaskResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetTask not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) SubmitTask(context.Context, *SubmitTaskRequest) (*SubmitTaskResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SubmitTask not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) GetSubmissionsHistory(context.Context, *GetSubmissionsHistoryRequest) (*GetSubmissionsHistoryResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetSubmissionsHistory not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) GetTaskAttachments(context.Context, *GetTaskAttachmentsRequest) (*GetTaskAttachmentsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetTaskAttachments not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) GetCompetitionResults(context.Context, *GetCompetitionResultsRequest) (*GetCompetitionResultsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetCompetitionResults not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServiceServer) mustEmbedUnimplementedTaskServiceServer() {}
|
||||
func (UnimplementedTaskServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeTaskServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to TaskServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeTaskServiceServer interface {
|
||||
mustEmbedUnimplementedTaskServiceServer()
|
||||
}
|
||||
|
||||
func RegisterTaskServiceServer(s grpc.ServiceRegistrar, srv TaskServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedTaskServiceServer 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(&TaskService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _TaskService_StartCompetition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(StartCompetitionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskServiceServer).StartCompetition(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskService_StartCompetition_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskServiceServer).StartCompetition(ctx, req.(*StartCompetitionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TaskService_GetCompetitionTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetCompetitionTasksRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskServiceServer).GetCompetitionTasks(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskService_GetCompetitionTasks_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskServiceServer).GetCompetitionTasks(ctx, req.(*GetCompetitionTasksRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TaskService_GetTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetTaskRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskServiceServer).GetTask(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskService_GetTask_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskServiceServer).GetTask(ctx, req.(*GetTaskRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TaskService_SubmitTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SubmitTaskRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskServiceServer).SubmitTask(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskService_SubmitTask_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskServiceServer).SubmitTask(ctx, req.(*SubmitTaskRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TaskService_GetSubmissionsHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetSubmissionsHistoryRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskServiceServer).GetSubmissionsHistory(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskService_GetSubmissionsHistory_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskServiceServer).GetSubmissionsHistory(ctx, req.(*GetSubmissionsHistoryRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TaskService_GetTaskAttachments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetTaskAttachmentsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskServiceServer).GetTaskAttachments(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskService_GetTaskAttachments_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskServiceServer).GetTaskAttachments(ctx, req.(*GetTaskAttachmentsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TaskService_GetCompetitionResults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetCompetitionResultsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskServiceServer).GetCompetitionResults(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskService_GetCompetitionResults_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskServiceServer).GetCompetitionResults(ctx, req.(*GetCompetitionResultsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// TaskService_ServiceDesc is the grpc.ServiceDesc for TaskService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var TaskService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "task.TaskService",
|
||||
HandlerType: (*TaskServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "StartCompetition",
|
||||
Handler: _TaskService_StartCompetition_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetCompetitionTasks",
|
||||
Handler: _TaskService_GetCompetitionTasks_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetTask",
|
||||
Handler: _TaskService_GetTask_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SubmitTask",
|
||||
Handler: _TaskService_SubmitTask_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetSubmissionsHistory",
|
||||
Handler: _TaskService_GetSubmissionsHistory_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetTaskAttachments",
|
||||
Handler: _TaskService_GetTaskAttachments_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetCompetitionResults",
|
||||
Handler: _TaskService_GetCompetitionResults_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "api/proto/task.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user