993 lines
36 KiB
Go
993 lines
36 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-go v1.36.11
|
|
// protoc v6.33.2
|
|
// source: api/proto/competition.proto
|
|
|
|
package competition
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
"net/http"
|
|
|
|
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
|
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
|
|
"google.golang.org/grpc"
|
|
"google.golang.org/grpc/codes"
|
|
"google.golang.org/grpc/grpclog"
|
|
"google.golang.org/grpc/metadata"
|
|
"google.golang.org/grpc/status"
|
|
"google.golang.org/protobuf/proto"
|
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
|
"reflect"
|
|
"sync"
|
|
)
|
|
|
|
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_DRAFT CompetitionState = 1
|
|
CompetitionState_COMPETITION_STATE_NOT_STARTED CompetitionState = 2
|
|
CompetitionState_COMPETITION_STATE_STARTED CompetitionState = 3
|
|
CompetitionState_COMPETITION_STATE_FINISHED CompetitionState = 4
|
|
CompetitionState_COMPETITION_STATE_ARCHIVED CompetitionState = 5
|
|
)
|
|
|
|
// Enum value maps for CompetitionState.
|
|
var (
|
|
CompetitionState_name = map[int32]string{
|
|
0: "COMPETITION_STATE_UNSPECIFIED",
|
|
1: "COMPETITION_STATE_DRAFT",
|
|
2: "COMPETITION_STATE_NOT_STARTED",
|
|
3: "COMPETITION_STATE_STARTED",
|
|
4: "COMPETITION_STATE_FINISHED",
|
|
5: "COMPETITION_STATE_ARCHIVED",
|
|
}
|
|
CompetitionState_value = map[string]int32{
|
|
"COMPETITION_STATE_UNSPECIFIED": 0,
|
|
"COMPETITION_STATE_DRAFT": 1,
|
|
"COMPETITION_STATE_NOT_STARTED": 2,
|
|
"COMPETITION_STATE_STARTED": 3,
|
|
"COMPETITION_STATE_FINISHED": 4,
|
|
"COMPETITION_STATE_ARCHIVED": 5,
|
|
}
|
|
)
|
|
|
|
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 ParticipationType int32
|
|
|
|
const (
|
|
ParticipationType_PARTICIPATION_TYPE_UNSPECIFIED ParticipationType = 0
|
|
ParticipationType_PARTICIPATION_TYPE_INDIVIDUAL ParticipationType = 1
|
|
ParticipationType_PARTICIPATION_TYPE_TEAM ParticipationType = 2
|
|
)
|
|
|
|
// Enum value maps for ParticipationType.
|
|
var (
|
|
ParticipationType_name = map[int32]string{
|
|
0: "PARTICIPATION_TYPE_UNSPECIFIED",
|
|
1: "PARTICIPATION_TYPE_INDIVIDUAL",
|
|
2: "PARTICIPATION_TYPE_TEAM",
|
|
}
|
|
ParticipationType_value = map[string]int32{
|
|
"PARTICIPATION_TYPE_UNSPECIFIED": 0,
|
|
"PARTICIPATION_TYPE_INDIVIDUAL": 1,
|
|
"PARTICIPATION_TYPE_TEAM": 2,
|
|
}
|
|
)
|
|
|
|
func (x ParticipationType) Enum() *ParticipationType {
|
|
p := new(ParticipationType)
|
|
*p = x
|
|
return p
|
|
}
|
|
|
|
func (x ParticipationType) String() string {
|
|
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
|
}
|
|
|
|
func (ParticipationType) Descriptor() protoreflect.EnumDescriptor {
|
|
return file_api_proto_competition_proto_enumTypes[1].Descriptor()
|
|
}
|
|
|
|
func (ParticipationType) Type() protoreflect.EnumType {
|
|
return &file_api_proto_competition_proto_enumTypes[1]
|
|
}
|
|
|
|
func (x ParticipationType) Number() protoreflect.EnumNumber {
|
|
return protoreflect.EnumNumber(x)
|
|
}
|
|
|
|
// Deprecated: Use ParticipationType.Descriptor instead.
|
|
func (ParticipationType) EnumDescriptor() ([]byte, []int) {
|
|
return file_api_proto_competition_proto_rawDescGZIP(), []int{1}
|
|
}
|
|
|
|
type CompetitionType int32
|
|
|
|
const (
|
|
CompetitionType_COMPETITION_TYPE_UNSPECIFIED CompetitionType = 0
|
|
CompetitionType_COMPETITION_TYPE_EDUCATIVE CompetitionType = 1
|
|
CompetitionType_COMPETITION_TYPE_COMPETETIVE CompetitionType = 2
|
|
)
|
|
|
|
// Enum value maps for CompetitionType.
|
|
var (
|
|
CompetitionType_name = map[int32]string{
|
|
0: "COMPETITION_TYPE_UNSPECIFIED",
|
|
1: "COMPETITION_TYPE_EDUCATIVE",
|
|
2: "COMPETITION_TYPE_COMPETETIVE",
|
|
}
|
|
CompetitionType_value = map[string]int32{
|
|
"COMPETITION_TYPE_UNSPECIFIED": 0,
|
|
"COMPETITION_TYPE_EDUCATIVE": 1,
|
|
"COMPETITION_TYPE_COMPETETIVE": 2,
|
|
}
|
|
)
|
|
|
|
func (x CompetitionType) Enum() *CompetitionType {
|
|
p := new(CompetitionType)
|
|
*p = x
|
|
return p
|
|
}
|
|
|
|
func (x CompetitionType) String() string {
|
|
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
|
}
|
|
|
|
func (CompetitionType) Descriptor() protoreflect.EnumDescriptor {
|
|
return file_api_proto_competition_proto_enumTypes[2].Descriptor()
|
|
}
|
|
|
|
func (CompetitionType) Type() protoreflect.EnumType {
|
|
return &file_api_proto_competition_proto_enumTypes[2]
|
|
}
|
|
|
|
func (x CompetitionType) Number() protoreflect.EnumNumber {
|
|
return protoreflect.EnumNumber(x)
|
|
}
|
|
|
|
// Deprecated: Use CompetitionType.Descriptor instead.
|
|
func (CompetitionType) EnumDescriptor() ([]byte, []int) {
|
|
return file_api_proto_competition_proto_rawDescGZIP(), []int{2}
|
|
}
|
|
|
|
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"`
|
|
StartTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
|
|
EndTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
|
|
Type CompetitionType `protobuf:"varint,8,opt,name=type,proto3,enum=competition.CompetitionType" json:"type,omitempty"`
|
|
ParticipationType ParticipationType `protobuf:"varint,9,opt,name=participation_type,json=participationType,proto3,enum=competition.ParticipationType" json:"participation_type,omitempty"`
|
|
CreatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
|
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *Competition) Reset() {
|
|
*x = Competition{}
|
|
mi := &file_api_proto_competition_proto_msgTypes[0]
|
|
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[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 Competition.ProtoReflect.Descriptor instead.
|
|
func (*Competition) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_competition_proto_rawDescGZIP(), []int{0}
|
|
}
|
|
|
|
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) GetStartTime() *timestamppb.Timestamp {
|
|
if x != nil {
|
|
return x.StartTime
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *Competition) GetEndTime() *timestamppb.Timestamp {
|
|
if x != nil {
|
|
return x.EndTime
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *Competition) GetType() CompetitionType {
|
|
if x != nil {
|
|
return x.Type
|
|
}
|
|
return CompetitionType_COMPETITION_TYPE_UNSPECIFIED
|
|
}
|
|
|
|
func (x *Competition) GetParticipationType() ParticipationType {
|
|
if x != nil {
|
|
return x.ParticipationType
|
|
}
|
|
return ParticipationType_PARTICIPATION_TYPE_UNSPECIFIED
|
|
}
|
|
|
|
func (x *Competition) GetCreatedAt() *timestamppb.Timestamp {
|
|
if x != nil {
|
|
return x.CreatedAt
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *Competition) GetUpdatedAt() *timestamppb.Timestamp {
|
|
if x != nil {
|
|
return x.UpdatedAt
|
|
}
|
|
return nil
|
|
}
|
|
|
|
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[1]
|
|
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[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 GetCompetitionRequest.ProtoReflect.Descriptor instead.
|
|
func (*GetCompetitionRequest) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_competition_proto_rawDescGZIP(), []int{1}
|
|
}
|
|
|
|
func (x *GetCompetitionRequest) GetCompetitionId() string {
|
|
if x != nil {
|
|
return x.CompetitionId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type DeleteCompetitionRequest 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 *DeleteCompetitionRequest) Reset() {
|
|
*x = DeleteCompetitionRequest{}
|
|
mi := &file_api_proto_competition_proto_msgTypes[2]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *DeleteCompetitionRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*DeleteCompetitionRequest) ProtoMessage() {}
|
|
|
|
func (x *DeleteCompetitionRequest) 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 DeleteCompetitionRequest.ProtoReflect.Descriptor instead.
|
|
func (*DeleteCompetitionRequest) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_competition_proto_rawDescGZIP(), []int{2}
|
|
}
|
|
|
|
func (x *DeleteCompetitionRequest) GetCompetitionId() string {
|
|
if x != nil {
|
|
return x.CompetitionId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type DeleteCompetitionResponse struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *DeleteCompetitionResponse) Reset() {
|
|
*x = DeleteCompetitionResponse{}
|
|
mi := &file_api_proto_competition_proto_msgTypes[3]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *DeleteCompetitionResponse) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*DeleteCompetitionResponse) ProtoMessage() {}
|
|
|
|
func (x *DeleteCompetitionResponse) 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 DeleteCompetitionResponse.ProtoReflect.Descriptor instead.
|
|
func (*DeleteCompetitionResponse) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_competition_proto_rawDescGZIP(), []int{3}
|
|
}
|
|
|
|
func (x *DeleteCompetitionResponse) GetSuccess() bool {
|
|
if x != nil {
|
|
return x.Success
|
|
}
|
|
return false
|
|
}
|
|
|
|
type ListCompetitionsRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
|
|
PageToken int32 `protobuf:"varint,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
|
|
State *CompetitionState `protobuf:"varint,3,opt,name=state,proto3,enum=competition.CompetitionState,oneof" json:"state,omitempty"`
|
|
IsParticipating *bool `protobuf:"varint,4,opt,name=is_participating,json=isParticipating,proto3,oneof" json:"is_participating,omitempty"`
|
|
SearchQuery *string `protobuf:"bytes,5,opt,name=search_query,json=searchQuery,proto3,oneof" json:"search_query,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *ListCompetitionsRequest) Reset() {
|
|
*x = ListCompetitionsRequest{}
|
|
mi := &file_api_proto_competition_proto_msgTypes[4]
|
|
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[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 ListCompetitionsRequest.ProtoReflect.Descriptor instead.
|
|
func (*ListCompetitionsRequest) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_competition_proto_rawDescGZIP(), []int{4}
|
|
}
|
|
|
|
func (x *ListCompetitionsRequest) GetPageSize() int32 {
|
|
if x != nil {
|
|
return x.PageSize
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *ListCompetitionsRequest) GetPageToken() int32 {
|
|
if x != nil {
|
|
return x.PageToken
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *ListCompetitionsRequest) GetState() CompetitionState {
|
|
if x != nil && x.State != nil {
|
|
return *x.State
|
|
}
|
|
return CompetitionState_COMPETITION_STATE_UNSPECIFIED
|
|
}
|
|
|
|
func (x *ListCompetitionsRequest) GetIsParticipating() bool {
|
|
if x != nil && x.IsParticipating != nil {
|
|
return *x.IsParticipating
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (x *ListCompetitionsRequest) GetSearchQuery() string {
|
|
if x != nil && x.SearchQuery != nil {
|
|
return *x.SearchQuery
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type ListCompetitionsResponse struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
TotalCount int32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"`
|
|
NextPageToken int32 `protobuf:"varint,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
|
|
Competitions []*Competition `protobuf:"bytes,3,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[5]
|
|
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[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 ListCompetitionsResponse.ProtoReflect.Descriptor instead.
|
|
func (*ListCompetitionsResponse) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_competition_proto_rawDescGZIP(), []int{5}
|
|
}
|
|
|
|
func (x *ListCompetitionsResponse) GetTotalCount() int32 {
|
|
if x != nil {
|
|
return x.TotalCount
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *ListCompetitionsResponse) GetNextPageToken() int32 {
|
|
if x != nil {
|
|
return x.NextPageToken
|
|
}
|
|
return 0
|
|
}
|
|
|
|
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[6]
|
|
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[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 ChangeCompetitionStateRequest.ProtoReflect.Descriptor instead.
|
|
func (*ChangeCompetitionStateRequest) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_competition_proto_rawDescGZIP(), []int{6}
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
var File_api_proto_competition_proto protoreflect.FileDescriptor
|
|
|
|
const file_api_proto_competition_proto_rawDesc = "" +
|
|
"\n" +
|
|
"\x1bapi/proto/competition.proto\x12\vcompetition\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa3\x04\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\x129\n" +
|
|
"\n" +
|
|
"start_time\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tstartTime\x125\n" +
|
|
"\bend_time\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\aendTime\x120\n" +
|
|
"\x04type\x18\b \x01(\x0e2\x1c.competition.CompetitionTypeR\x04type\x12M\n" +
|
|
"\x12participation_type\x18\t \x01(\x0e2\x1e.competition.ParticipationTypeR\x11participationType\x129\n" +
|
|
"\n" +
|
|
"created_at\x18\n" +
|
|
" \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" +
|
|
"\n" +
|
|
"updated_at\x18\v \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAtB\f\n" +
|
|
"\n" +
|
|
"_image_url\">\n" +
|
|
"\x15GetCompetitionRequest\x12%\n" +
|
|
"\x0ecompetition_id\x18\x01 \x01(\tR\rcompetitionId\"A\n" +
|
|
"\x18DeleteCompetitionRequest\x12%\n" +
|
|
"\x0ecompetition_id\x18\x01 \x01(\tR\rcompetitionId\"5\n" +
|
|
"\x19DeleteCompetitionResponse\x12\x18\n" +
|
|
"\asuccess\x18\x01 \x01(\bR\asuccess\"\x97\x02\n" +
|
|
"\x17ListCompetitionsRequest\x12\x1b\n" +
|
|
"\tpage_size\x18\x01 \x01(\x05R\bpageSize\x12\x1d\n" +
|
|
"\n" +
|
|
"page_token\x18\x02 \x01(\x05R\tpageToken\x128\n" +
|
|
"\x05state\x18\x03 \x01(\x0e2\x1d.competition.CompetitionStateH\x00R\x05state\x88\x01\x01\x12.\n" +
|
|
"\x10is_participating\x18\x04 \x01(\bH\x01R\x0fisParticipating\x88\x01\x01\x12&\n" +
|
|
"\fsearch_query\x18\x05 \x01(\tH\x02R\vsearchQuery\x88\x01\x01B\b\n" +
|
|
"\x06_stateB\x13\n" +
|
|
"\x11_is_participatingB\x0f\n" +
|
|
"\r_search_query\"\xa1\x01\n" +
|
|
"\x18ListCompetitionsResponse\x12\x1f\n" +
|
|
"\vtotal_count\x18\x01 \x01(\x05R\n" +
|
|
"totalCount\x12&\n" +
|
|
"\x0fnext_page_token\x18\x02 \x01(\x05R\rnextPageToken\x12<\n" +
|
|
"\fcompetitions\x18\x03 \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*\xd4\x01\n" +
|
|
"\x10CompetitionState\x12!\n" +
|
|
"\x1dCOMPETITION_STATE_UNSPECIFIED\x10\x00\x12\x1b\n" +
|
|
"\x17COMPETITION_STATE_DRAFT\x10\x01\x12!\n" +
|
|
"\x1dCOMPETITION_STATE_NOT_STARTED\x10\x02\x12\x1d\n" +
|
|
"\x19COMPETITION_STATE_STARTED\x10\x03\x12\x1e\n" +
|
|
"\x1aCOMPETITION_STATE_FINISHED\x10\x04\x12\x1e\n" +
|
|
"\x1aCOMPETITION_STATE_ARCHIVED\x10\x05*w\n" +
|
|
"\x11ParticipationType\x12\"\n" +
|
|
"\x1ePARTICIPATION_TYPE_UNSPECIFIED\x10\x00\x12!\n" +
|
|
"\x1dPARTICIPATION_TYPE_INDIVIDUAL\x10\x01\x12\x1b\n" +
|
|
"\x17PARTICIPATION_TYPE_TEAM\x10\x02*u\n" +
|
|
"\x0fCompetitionType\x12 \n" +
|
|
"\x1cCOMPETITION_TYPE_UNSPECIFIED\x10\x00\x12\x1e\n" +
|
|
"\x1aCOMPETITION_TYPE_EDUCATIVE\x10\x01\x12 \n" +
|
|
"\x1cCOMPETITION_TYPE_COMPETETIVE\x10\x022\x99\x04\n" +
|
|
"\x12CompetitionService\x12G\n" +
|
|
"\x11CreateCompetition\x12\x18.competition.Competition\x1a\x18.competition.Competition\x12N\n" +
|
|
"\x0eGetCompetition\x12\".competition.GetCompetitionRequest\x1a\x18.competition.Competition\x12E\n" +
|
|
"\x0fEditCompetition\x12\x18.competition.Competition\x1a\x18.competition.Competition\x12b\n" +
|
|
"\x11DeleteCompetition\x12%.competition.DeleteCompetitionRequest\x1a&.competition.DeleteCompetitionResponse\x12_\n" +
|
|
"\x10ListCompetitions\x12$.competition.ListCompetitionsRequest\x1a%.competition.ListCompetitionsResponse\x12^\n" +
|
|
"\x16ChangeCompetitionState\x12*.competition.ChangeCompetitionStateRequest\x1a\x18.competition.CompetitionB\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, 3)
|
|
var file_api_proto_competition_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
|
var file_api_proto_competition_proto_goTypes = []any{
|
|
(CompetitionState)(0), // 0: competition.CompetitionState
|
|
(ParticipationType)(0), // 1: competition.ParticipationType
|
|
(CompetitionType)(0), // 2: competition.CompetitionType
|
|
(*Competition)(nil), // 3: competition.Competition
|
|
(*GetCompetitionRequest)(nil), // 4: competition.GetCompetitionRequest
|
|
(*DeleteCompetitionRequest)(nil), // 5: competition.DeleteCompetitionRequest
|
|
(*DeleteCompetitionResponse)(nil), // 6: competition.DeleteCompetitionResponse
|
|
(*ListCompetitionsRequest)(nil), // 7: competition.ListCompetitionsRequest
|
|
(*ListCompetitionsResponse)(nil), // 8: competition.ListCompetitionsResponse
|
|
(*ChangeCompetitionStateRequest)(nil), // 9: competition.ChangeCompetitionStateRequest
|
|
(*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp
|
|
}
|
|
var file_api_proto_competition_proto_depIdxs = []int32{
|
|
0, // 0: competition.Competition.state:type_name -> competition.CompetitionState
|
|
10, // 1: competition.Competition.start_time:type_name -> google.protobuf.Timestamp
|
|
10, // 2: competition.Competition.end_time:type_name -> google.protobuf.Timestamp
|
|
2, // 3: competition.Competition.type:type_name -> competition.CompetitionType
|
|
1, // 4: competition.Competition.participation_type:type_name -> competition.ParticipationType
|
|
10, // 5: competition.Competition.created_at:type_name -> google.protobuf.Timestamp
|
|
10, // 6: competition.Competition.updated_at:type_name -> google.protobuf.Timestamp
|
|
0, // 7: competition.ListCompetitionsRequest.state:type_name -> competition.CompetitionState
|
|
3, // 8: competition.ListCompetitionsResponse.competitions:type_name -> competition.Competition
|
|
0, // 9: competition.ChangeCompetitionStateRequest.state:type_name -> competition.CompetitionState
|
|
3, // 10: competition.CompetitionService.CreateCompetition:input_type -> competition.Competition
|
|
4, // 11: competition.CompetitionService.GetCompetition:input_type -> competition.GetCompetitionRequest
|
|
3, // 12: competition.CompetitionService.EditCompetition:input_type -> competition.Competition
|
|
5, // 13: competition.CompetitionService.DeleteCompetition:input_type -> competition.DeleteCompetitionRequest
|
|
7, // 14: competition.CompetitionService.ListCompetitions:input_type -> competition.ListCompetitionsRequest
|
|
9, // 15: competition.CompetitionService.ChangeCompetitionState:input_type -> competition.ChangeCompetitionStateRequest
|
|
3, // 16: competition.CompetitionService.CreateCompetition:output_type -> competition.Competition
|
|
3, // 17: competition.CompetitionService.GetCompetition:output_type -> competition.Competition
|
|
3, // 18: competition.CompetitionService.EditCompetition:output_type -> competition.Competition
|
|
6, // 19: competition.CompetitionService.DeleteCompetition:output_type -> competition.DeleteCompetitionResponse
|
|
8, // 20: competition.CompetitionService.ListCompetitions:output_type -> competition.ListCompetitionsResponse
|
|
3, // 21: competition.CompetitionService.ChangeCompetitionState:output_type -> competition.Competition
|
|
16, // [16:22] is the sub-list for method output_type
|
|
10, // [10:16] is the sub-list for method input_type
|
|
10, // [10:10] is the sub-list for extension type_name
|
|
10, // [10:10] is the sub-list for extension extendee
|
|
0, // [0:10] 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[0].OneofWrappers = []any{}
|
|
file_api_proto_competition_proto_msgTypes[4].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: 3,
|
|
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
|
|
}
|
|
|
|
func RegisterCompetitionServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
|
return RegisterCompetitionServiceHandlerClient(ctx, mux, NewCompetitionServiceClient(conn))
|
|
}
|
|
|
|
|
|
func RegisterCompetitionServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CompetitionServiceClient) error {
|
|
var err error
|
|
err = mux.Handle("POST", runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "competitions"}, "")), func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(req.Context())
|
|
defer cancel()
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
var err error
|
|
var annotatedContext context.Context
|
|
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/competition.CompetitionService/CreateCompetition", runtime.WithHTTPPathPattern("/v1/competitions"))
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
resp, md, err := request_CompetitionService_CreateCompetition_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
|
if err != nil {
|
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_CompetitionService_CreateCompetition_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = mux.Handle("GET", runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "competitions", "competition_id"}, "")), func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(req.Context())
|
|
defer cancel()
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
var err error
|
|
var annotatedContext context.Context
|
|
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/competition.CompetitionService/GetCompetition", runtime.WithHTTPPathPattern("/v1/competitions/{competition_id}"))
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
resp, md, err := request_CompetitionService_GetCompetition_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
|
if err != nil {
|
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_CompetitionService_GetCompetition_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = mux.Handle("PUT", runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "competitions", "id"}, "")), func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(req.Context())
|
|
defer cancel()
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
var err error
|
|
var annotatedContext context.Context
|
|
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/competition.CompetitionService/EditCompetition", runtime.WithHTTPPathPattern("/v1/competitions/{id}"))
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
resp, md, err := request_CompetitionService_EditCompetition_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
|
if err != nil {
|
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_CompetitionService_EditCompetition_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = mux.Handle("DELETE", runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "competitions", "competition_id"}, "")), func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(req.Context())
|
|
defer cancel()
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
var err error
|
|
var annotatedContext context.Context
|
|
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/competition.CompetitionService/DeleteCompetition", runtime.WithHTTPPathPattern("/v1/competitions/{competition_id}"))
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
resp, md, err := request_CompetitionService_DeleteCompetition_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
|
if err != nil {
|
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_CompetitionService_DeleteCompetition_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = mux.Handle("GET", runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "competitions"}, "")), func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(req.Context())
|
|
defer cancel()
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
var err error
|
|
var annotatedContext context.Context
|
|
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/competition.CompetitionService/ListCompetitions", runtime.WithHTTPPathPattern("/v1/competitions"))
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
resp, md, err := request_CompetitionService_ListCompetitions_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
|
if err != nil {
|
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_CompetitionService_ListCompetitions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = mux.Handle("POST", runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1", "competitions", "competition_id", "state"}, "")), func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
ctx, cancel := context.WithCancel(req.Context())
|
|
defer cancel()
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
var err error
|
|
var annotatedContext context.Context
|
|
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/competition.CompetitionService/ChangeCompetitionState", runtime.WithHTTPPathPattern("/v1/competitions/{competition_id}/state"))
|
|
if err != nil {
|
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
resp, md, err := request_CompetitionService_ChangeCompetitionState_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
|
if err != nil {
|
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
|
return
|
|
}
|
|
|
|
forward_CompetitionService_ChangeCompetitionState_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func RegisterCompetitionServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
|
conn, err := grpc.DialContext(ctx, endpoint, opts...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
defer func() {
|
|
if err != nil {
|
|
if cerr := conn.Close(); cerr != nil {
|
|
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
|
}
|
|
return
|
|
}
|
|
go func() {
|
|
<-ctx.Done()
|
|
if cerr := conn.Close(); cerr != nil {
|
|
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
|
}
|
|
}()
|
|
}()
|
|
|
|
return RegisterCompetitionServiceHandler(ctx, mux, conn)
|
|
}
|
|
|
|
func request_CompetitionService_CreateCompetition_0(ctx context.Context, marshaler runtime.Marshaler, client CompetitionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
var protoReq Competition
|
|
var metadata runtime.ServerMetadata
|
|
|
|
newReader, berr := utilities.IOReaderFactory(req.Body)
|
|
if berr != nil {
|
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
|
}
|
|
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
}
|
|
|
|
msg, err := client.CreateCompetition(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
return msg, metadata, err
|
|
|
|
}
|
|
|
|
func forward_CompetitionService_CreateCompetition_0(ctx context.Context, mux *runtime.ServeMux, marshaler runtime.Marshaler, w http.ResponseWriter, req *http.Request, resp proto.Message, opts ...func(context.Context, http.ResponseWriter, proto.Message)) {
|
|
runtime.ForwardResponseMessage(ctx, mux, marshaler, w, req, resp, opts...)
|
|
}
|