From 18239945fb2f7df2152489a5ed77d3bdea203bdd Mon Sep 17 00:00:00 2001 From: tosuke <13393900+tosuke@users.noreply.github.com> Date: Thu, 2 Jan 2025 13:09:20 +0900 Subject: [PATCH] feat: add contesntant.v1.ProblemService --- .../v1/contestantv1connect/problem.connect.go | 172 ++++ backend/pkg/proto/contestant/v1/problem.pb.go | 969 ++++++++++++++++++ .../packages/proto/exports/contestant-v1.ts | 1 + .../proto/proto/contestant/v1/problem_pb.ts | 394 +++++++ proto/contestant/v1/problem.proto | 95 ++ 5 files changed, 1631 insertions(+) create mode 100644 backend/pkg/proto/contestant/v1/contestantv1connect/problem.connect.go create mode 100644 backend/pkg/proto/contestant/v1/problem.pb.go create mode 100644 frontend/packages/proto/proto/contestant/v1/problem_pb.ts create mode 100644 proto/contestant/v1/problem.proto diff --git a/backend/pkg/proto/contestant/v1/contestantv1connect/problem.connect.go b/backend/pkg/proto/contestant/v1/contestantv1connect/problem.connect.go new file mode 100644 index 00000000..9b86a97d --- /dev/null +++ b/backend/pkg/proto/contestant/v1/contestantv1connect/problem.connect.go @@ -0,0 +1,172 @@ +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: contestant/v1/problem.proto + +package contestantv1connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v1 "github.com/ictsc/ictsc-regalia/backend/pkg/proto/contestant/v1" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect.IsAtLeastVersion1_13_0 + +const ( + // ProblemServiceName is the fully-qualified name of the ProblemService service. + ProblemServiceName = "contestant.v1.ProblemService" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // ProblemServiceListProblemsProcedure is the fully-qualified name of the ProblemService's + // ListProblems RPC. + ProblemServiceListProblemsProcedure = "/contestant.v1.ProblemService/ListProblems" + // ProblemServiceGetProblemProcedure is the fully-qualified name of the ProblemService's GetProblem + // RPC. + ProblemServiceGetProblemProcedure = "/contestant.v1.ProblemService/GetProblem" + // ProblemServiceDeployProcedure is the fully-qualified name of the ProblemService's Deploy RPC. + ProblemServiceDeployProcedure = "/contestant.v1.ProblemService/Deploy" +) + +// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package. +var ( + problemServiceServiceDescriptor = v1.File_contestant_v1_problem_proto.Services().ByName("ProblemService") + problemServiceListProblemsMethodDescriptor = problemServiceServiceDescriptor.Methods().ByName("ListProblems") + problemServiceGetProblemMethodDescriptor = problemServiceServiceDescriptor.Methods().ByName("GetProblem") + problemServiceDeployMethodDescriptor = problemServiceServiceDescriptor.Methods().ByName("Deploy") +) + +// ProblemServiceClient is a client for the contestant.v1.ProblemService service. +type ProblemServiceClient interface { + ListProblems(context.Context, *connect.Request[v1.ListProblemsRequest]) (*connect.Response[v1.ListProblemsResponse], error) + GetProblem(context.Context, *connect.Request[v1.GetProblemRequest]) (*connect.Response[v1.GetProblemResponse], error) + Deploy(context.Context, *connect.Request[v1.DeployRequest]) (*connect.Response[v1.DeployResponse], error) +} + +// NewProblemServiceClient constructs a client for the contestant.v1.ProblemService service. By +// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, +// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the +// connect.WithGRPC() or connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewProblemServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ProblemServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + return &problemServiceClient{ + listProblems: connect.NewClient[v1.ListProblemsRequest, v1.ListProblemsResponse]( + httpClient, + baseURL+ProblemServiceListProblemsProcedure, + connect.WithSchema(problemServiceListProblemsMethodDescriptor), + connect.WithClientOptions(opts...), + ), + getProblem: connect.NewClient[v1.GetProblemRequest, v1.GetProblemResponse]( + httpClient, + baseURL+ProblemServiceGetProblemProcedure, + connect.WithSchema(problemServiceGetProblemMethodDescriptor), + connect.WithClientOptions(opts...), + ), + deploy: connect.NewClient[v1.DeployRequest, v1.DeployResponse]( + httpClient, + baseURL+ProblemServiceDeployProcedure, + connect.WithSchema(problemServiceDeployMethodDescriptor), + connect.WithClientOptions(opts...), + ), + } +} + +// problemServiceClient implements ProblemServiceClient. +type problemServiceClient struct { + listProblems *connect.Client[v1.ListProblemsRequest, v1.ListProblemsResponse] + getProblem *connect.Client[v1.GetProblemRequest, v1.GetProblemResponse] + deploy *connect.Client[v1.DeployRequest, v1.DeployResponse] +} + +// ListProblems calls contestant.v1.ProblemService.ListProblems. +func (c *problemServiceClient) ListProblems(ctx context.Context, req *connect.Request[v1.ListProblemsRequest]) (*connect.Response[v1.ListProblemsResponse], error) { + return c.listProblems.CallUnary(ctx, req) +} + +// GetProblem calls contestant.v1.ProblemService.GetProblem. +func (c *problemServiceClient) GetProblem(ctx context.Context, req *connect.Request[v1.GetProblemRequest]) (*connect.Response[v1.GetProblemResponse], error) { + return c.getProblem.CallUnary(ctx, req) +} + +// Deploy calls contestant.v1.ProblemService.Deploy. +func (c *problemServiceClient) Deploy(ctx context.Context, req *connect.Request[v1.DeployRequest]) (*connect.Response[v1.DeployResponse], error) { + return c.deploy.CallUnary(ctx, req) +} + +// ProblemServiceHandler is an implementation of the contestant.v1.ProblemService service. +type ProblemServiceHandler interface { + ListProblems(context.Context, *connect.Request[v1.ListProblemsRequest]) (*connect.Response[v1.ListProblemsResponse], error) + GetProblem(context.Context, *connect.Request[v1.GetProblemRequest]) (*connect.Response[v1.GetProblemResponse], error) + Deploy(context.Context, *connect.Request[v1.DeployRequest]) (*connect.Response[v1.DeployResponse], error) +} + +// NewProblemServiceHandler builds an HTTP handler from the service implementation. It returns the +// path on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewProblemServiceHandler(svc ProblemServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + problemServiceListProblemsHandler := connect.NewUnaryHandler( + ProblemServiceListProblemsProcedure, + svc.ListProblems, + connect.WithSchema(problemServiceListProblemsMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) + problemServiceGetProblemHandler := connect.NewUnaryHandler( + ProblemServiceGetProblemProcedure, + svc.GetProblem, + connect.WithSchema(problemServiceGetProblemMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) + problemServiceDeployHandler := connect.NewUnaryHandler( + ProblemServiceDeployProcedure, + svc.Deploy, + connect.WithSchema(problemServiceDeployMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) + return "/contestant.v1.ProblemService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case ProblemServiceListProblemsProcedure: + problemServiceListProblemsHandler.ServeHTTP(w, r) + case ProblemServiceGetProblemProcedure: + problemServiceGetProblemHandler.ServeHTTP(w, r) + case ProblemServiceDeployProcedure: + problemServiceDeployHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedProblemServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedProblemServiceHandler struct{} + +func (UnimplementedProblemServiceHandler) ListProblems(context.Context, *connect.Request[v1.ListProblemsRequest]) (*connect.Response[v1.ListProblemsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("contestant.v1.ProblemService.ListProblems is not implemented")) +} + +func (UnimplementedProblemServiceHandler) GetProblem(context.Context, *connect.Request[v1.GetProblemRequest]) (*connect.Response[v1.GetProblemResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("contestant.v1.ProblemService.GetProblem is not implemented")) +} + +func (UnimplementedProblemServiceHandler) Deploy(context.Context, *connect.Request[v1.DeployRequest]) (*connect.Response[v1.DeployResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("contestant.v1.ProblemService.Deploy is not implemented")) +} diff --git a/backend/pkg/proto/contestant/v1/problem.pb.go b/backend/pkg/proto/contestant/v1/problem.pb.go new file mode 100644 index 00000000..5d718ffd --- /dev/null +++ b/backend/pkg/proto/contestant/v1/problem.pb.go @@ -0,0 +1,969 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc (unknown) +// source: contestant/v1/problem.proto + +package contestantv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "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 DeploymentStatus int32 + +const ( + DeploymentStatus_DEPLOYMENT_STATUS_UNSPECIFIED DeploymentStatus = 0 + // 展開済み + DeploymentStatus_DEPLOYMENT_STATUS_DEPLOYED DeploymentStatus = 1 + // 展開中 + DeploymentStatus_DEPLOYMENT_STATUS_DEPLOYING DeploymentStatus = 2 + // 展開失敗 + DeploymentStatus_DEPLOYMENT_STATUS_FAILED DeploymentStatus = 3 +) + +// Enum value maps for DeploymentStatus. +var ( + DeploymentStatus_name = map[int32]string{ + 0: "DEPLOYMENT_STATUS_UNSPECIFIED", + 1: "DEPLOYMENT_STATUS_DEPLOYED", + 2: "DEPLOYMENT_STATUS_DEPLOYING", + 3: "DEPLOYMENT_STATUS_FAILED", + } + DeploymentStatus_value = map[string]int32{ + "DEPLOYMENT_STATUS_UNSPECIFIED": 0, + "DEPLOYMENT_STATUS_DEPLOYED": 1, + "DEPLOYMENT_STATUS_DEPLOYING": 2, + "DEPLOYMENT_STATUS_FAILED": 3, + } +) + +func (x DeploymentStatus) Enum() *DeploymentStatus { + p := new(DeploymentStatus) + *p = x + return p +} + +func (x DeploymentStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DeploymentStatus) Descriptor() protoreflect.EnumDescriptor { + return file_contestant_v1_problem_proto_enumTypes[0].Descriptor() +} + +func (DeploymentStatus) Type() protoreflect.EnumType { + return &file_contestant_v1_problem_proto_enumTypes[0] +} + +func (x DeploymentStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use DeploymentStatus.Descriptor instead. +func (DeploymentStatus) EnumDescriptor() ([]byte, []int) { + return file_contestant_v1_problem_proto_rawDescGZIP(), []int{0} +} + +type ProblemType int32 + +const ( + ProblemType_PROBLEM_TYPE_UNSPECIFIED ProblemType = 0 + ProblemType_PROBLEM_TYPE_DESCRIPTIVE ProblemType = 1 +) + +// Enum value maps for ProblemType. +var ( + ProblemType_name = map[int32]string{ + 0: "PROBLEM_TYPE_UNSPECIFIED", + 1: "PROBLEM_TYPE_DESCRIPTIVE", + } + ProblemType_value = map[string]int32{ + "PROBLEM_TYPE_UNSPECIFIED": 0, + "PROBLEM_TYPE_DESCRIPTIVE": 1, + } +) + +func (x ProblemType) Enum() *ProblemType { + p := new(ProblemType) + *p = x + return p +} + +func (x ProblemType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ProblemType) Descriptor() protoreflect.EnumDescriptor { + return file_contestant_v1_problem_proto_enumTypes[1].Descriptor() +} + +func (ProblemType) Type() protoreflect.EnumType { + return &file_contestant_v1_problem_proto_enumTypes[1] +} + +func (x ProblemType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ProblemType.Descriptor instead. +func (ProblemType) EnumDescriptor() ([]byte, []int) { + return file_contestant_v1_problem_proto_rawDescGZIP(), []int{1} +} + +type Problem struct { + state protoimpl.MessageState `protogen:"open.v1"` + // 問題コード + Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` + // タイトル + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + // 最大得点 + MaxScore int64 `protobuf:"varint,3,opt,name=max_score,json=maxScore,proto3" json:"max_score,omitempty"` + Score *Score `protobuf:"bytes,4,opt,name=score,proto3,oneof" json:"score,omitempty"` + Deployment *Deployment `protobuf:"bytes,5,opt,name=deployment,proto3" json:"deployment,omitempty"` + Body *ProblemBody `protobuf:"bytes,6,opt,name=body,proto3" json:"body,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Problem) Reset() { + *x = Problem{} + mi := &file_contestant_v1_problem_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Problem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Problem) ProtoMessage() {} + +func (x *Problem) ProtoReflect() protoreflect.Message { + mi := &file_contestant_v1_problem_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 Problem.ProtoReflect.Descriptor instead. +func (*Problem) Descriptor() ([]byte, []int) { + return file_contestant_v1_problem_proto_rawDescGZIP(), []int{0} +} + +func (x *Problem) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *Problem) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *Problem) GetMaxScore() int64 { + if x != nil { + return x.MaxScore + } + return 0 +} + +func (x *Problem) GetScore() *Score { + if x != nil { + return x.Score + } + return nil +} + +func (x *Problem) GetDeployment() *Deployment { + if x != nil { + return x.Deployment + } + return nil +} + +func (x *Problem) GetBody() *ProblemBody { + if x != nil { + return x.Body + } + return nil +} + +type Score struct { + state protoimpl.MessageState `protogen:"open.v1"` + // 採点による得点 + MarkedScore int64 `protobuf:"varint,1,opt,name=marked_score,json=markedScore,proto3" json:"marked_score,omitempty"` + // ペナルティによる減点 + Penalty int64 `protobuf:"varint,2,opt,name=penalty,proto3" json:"penalty,omitempty"` + // 最終的な得点 + Score int64 `protobuf:"varint,3,opt,name=score,proto3" json:"score,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Score) Reset() { + *x = Score{} + mi := &file_contestant_v1_problem_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Score) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Score) ProtoMessage() {} + +func (x *Score) ProtoReflect() protoreflect.Message { + mi := &file_contestant_v1_problem_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 Score.ProtoReflect.Descriptor instead. +func (*Score) Descriptor() ([]byte, []int) { + return file_contestant_v1_problem_proto_rawDescGZIP(), []int{1} +} + +func (x *Score) GetMarkedScore() int64 { + if x != nil { + return x.MarkedScore + } + return 0 +} + +func (x *Score) GetPenalty() int64 { + if x != nil { + return x.Penalty + } + return 0 +} + +func (x *Score) GetScore() int64 { + if x != nil { + return x.Score + } + return 0 +} + +type Deployment struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status DeploymentStatus `protobuf:"varint,1,opt,name=status,proto3,enum=contestant.v1.DeploymentStatus" json:"status,omitempty"` + Redeployable bool `protobuf:"varint,2,opt,name=redeployable,proto3" json:"redeployable,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Deployment) Reset() { + *x = Deployment{} + mi := &file_contestant_v1_problem_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Deployment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Deployment) ProtoMessage() {} + +func (x *Deployment) ProtoReflect() protoreflect.Message { + mi := &file_contestant_v1_problem_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 Deployment.ProtoReflect.Descriptor instead. +func (*Deployment) Descriptor() ([]byte, []int) { + return file_contestant_v1_problem_proto_rawDescGZIP(), []int{2} +} + +func (x *Deployment) GetStatus() DeploymentStatus { + if x != nil { + return x.Status + } + return DeploymentStatus_DEPLOYMENT_STATUS_UNSPECIFIED +} + +func (x *Deployment) GetRedeployable() bool { + if x != nil { + return x.Redeployable + } + return false +} + +type ProblemBody struct { + state protoimpl.MessageState `protogen:"open.v1"` + Type ProblemType `protobuf:"varint,1,opt,name=type,proto3,enum=contestant.v1.ProblemType" json:"type,omitempty"` + // Types that are valid to be assigned to Body: + // + // *ProblemBody_Descriptive + Body isProblemBody_Body `protobuf_oneof:"body"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProblemBody) Reset() { + *x = ProblemBody{} + mi := &file_contestant_v1_problem_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProblemBody) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProblemBody) ProtoMessage() {} + +func (x *ProblemBody) ProtoReflect() protoreflect.Message { + mi := &file_contestant_v1_problem_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 ProblemBody.ProtoReflect.Descriptor instead. +func (*ProblemBody) Descriptor() ([]byte, []int) { + return file_contestant_v1_problem_proto_rawDescGZIP(), []int{3} +} + +func (x *ProblemBody) GetType() ProblemType { + if x != nil { + return x.Type + } + return ProblemType_PROBLEM_TYPE_UNSPECIFIED +} + +func (x *ProblemBody) GetBody() isProblemBody_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *ProblemBody) GetDescriptive() *DescriptiveProblem { + if x != nil { + if x, ok := x.Body.(*ProblemBody_Descriptive); ok { + return x.Descriptive + } + } + return nil +} + +type isProblemBody_Body interface { + isProblemBody_Body() +} + +type ProblemBody_Descriptive struct { + Descriptive *DescriptiveProblem `protobuf:"bytes,2,opt,name=descriptive,proto3,oneof"` +} + +func (*ProblemBody_Descriptive) isProblemBody_Body() {} + +type Connection struct { + state protoimpl.MessageState `protogen:"open.v1"` + // ホスト名 + HostName string `protobuf:"bytes,1,opt,name=host_name,json=hostName,proto3" json:"host_name,omitempty"` + // ホスト(IP アドレス or ドメイン) + Host string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"` + // ユーザ + User *string `protobuf:"bytes,3,opt,name=user,proto3,oneof" json:"user,omitempty"` + // パスワード + Password *string `protobuf:"bytes,4,opt,name=password,proto3,oneof" json:"password,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Connection) Reset() { + *x = Connection{} + mi := &file_contestant_v1_problem_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Connection) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Connection) ProtoMessage() {} + +func (x *Connection) ProtoReflect() protoreflect.Message { + mi := &file_contestant_v1_problem_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 Connection.ProtoReflect.Descriptor instead. +func (*Connection) Descriptor() ([]byte, []int) { + return file_contestant_v1_problem_proto_rawDescGZIP(), []int{4} +} + +func (x *Connection) GetHostName() string { + if x != nil { + return x.HostName + } + return "" +} + +func (x *Connection) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *Connection) GetUser() string { + if x != nil && x.User != nil { + return *x.User + } + return "" +} + +func (x *Connection) GetPassword() string { + if x != nil && x.Password != nil { + return *x.Password + } + return "" +} + +type DescriptiveProblem struct { + state protoimpl.MessageState `protogen:"open.v1"` + // 問題文 + Body string `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // 接続情報 + Connection []*Connection `protobuf:"bytes,2,rep,name=connection,proto3" json:"connection,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DescriptiveProblem) Reset() { + *x = DescriptiveProblem{} + mi := &file_contestant_v1_problem_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DescriptiveProblem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescriptiveProblem) ProtoMessage() {} + +func (x *DescriptiveProblem) ProtoReflect() protoreflect.Message { + mi := &file_contestant_v1_problem_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 DescriptiveProblem.ProtoReflect.Descriptor instead. +func (*DescriptiveProblem) Descriptor() ([]byte, []int) { + return file_contestant_v1_problem_proto_rawDescGZIP(), []int{5} +} + +func (x *DescriptiveProblem) GetBody() string { + if x != nil { + return x.Body + } + return "" +} + +func (x *DescriptiveProblem) GetConnection() []*Connection { + if x != nil { + return x.Connection + } + return nil +} + +type ListProblemsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListProblemsRequest) Reset() { + *x = ListProblemsRequest{} + mi := &file_contestant_v1_problem_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListProblemsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListProblemsRequest) ProtoMessage() {} + +func (x *ListProblemsRequest) ProtoReflect() protoreflect.Message { + mi := &file_contestant_v1_problem_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 ListProblemsRequest.ProtoReflect.Descriptor instead. +func (*ListProblemsRequest) Descriptor() ([]byte, []int) { + return file_contestant_v1_problem_proto_rawDescGZIP(), []int{6} +} + +type ListProblemsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Problems []*Problem `protobuf:"bytes,1,rep,name=problems,proto3" json:"problems,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListProblemsResponse) Reset() { + *x = ListProblemsResponse{} + mi := &file_contestant_v1_problem_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListProblemsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListProblemsResponse) ProtoMessage() {} + +func (x *ListProblemsResponse) ProtoReflect() protoreflect.Message { + mi := &file_contestant_v1_problem_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 ListProblemsResponse.ProtoReflect.Descriptor instead. +func (*ListProblemsResponse) Descriptor() ([]byte, []int) { + return file_contestant_v1_problem_proto_rawDescGZIP(), []int{7} +} + +func (x *ListProblemsResponse) GetProblems() []*Problem { + if x != nil { + return x.Problems + } + return nil +} + +type GetProblemRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetProblemRequest) Reset() { + *x = GetProblemRequest{} + mi := &file_contestant_v1_problem_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetProblemRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProblemRequest) ProtoMessage() {} + +func (x *GetProblemRequest) ProtoReflect() protoreflect.Message { + mi := &file_contestant_v1_problem_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 GetProblemRequest.ProtoReflect.Descriptor instead. +func (*GetProblemRequest) Descriptor() ([]byte, []int) { + return file_contestant_v1_problem_proto_rawDescGZIP(), []int{8} +} + +func (x *GetProblemRequest) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +type GetProblemResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Problem *Problem `protobuf:"bytes,1,opt,name=problem,proto3" json:"problem,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetProblemResponse) Reset() { + *x = GetProblemResponse{} + mi := &file_contestant_v1_problem_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetProblemResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProblemResponse) ProtoMessage() {} + +func (x *GetProblemResponse) ProtoReflect() protoreflect.Message { + mi := &file_contestant_v1_problem_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 GetProblemResponse.ProtoReflect.Descriptor instead. +func (*GetProblemResponse) Descriptor() ([]byte, []int) { + return file_contestant_v1_problem_proto_rawDescGZIP(), []int{9} +} + +func (x *GetProblemResponse) GetProblem() *Problem { + if x != nil { + return x.Problem + } + return nil +} + +type DeployRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeployRequest) Reset() { + *x = DeployRequest{} + mi := &file_contestant_v1_problem_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeployRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeployRequest) ProtoMessage() {} + +func (x *DeployRequest) ProtoReflect() protoreflect.Message { + mi := &file_contestant_v1_problem_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 DeployRequest.ProtoReflect.Descriptor instead. +func (*DeployRequest) Descriptor() ([]byte, []int) { + return file_contestant_v1_problem_proto_rawDescGZIP(), []int{10} +} + +func (x *DeployRequest) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +type DeployResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeployResponse) Reset() { + *x = DeployResponse{} + mi := &file_contestant_v1_problem_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeployResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeployResponse) ProtoMessage() {} + +func (x *DeployResponse) ProtoReflect() protoreflect.Message { + mi := &file_contestant_v1_problem_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 DeployResponse.ProtoReflect.Descriptor instead. +func (*DeployResponse) Descriptor() ([]byte, []int) { + return file_contestant_v1_problem_proto_rawDescGZIP(), []int{11} +} + +var File_contestant_v1_problem_proto protoreflect.FileDescriptor + +var file_contestant_v1_problem_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, + 0x70, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x22, 0xf6, 0x01, 0x0a, + 0x07, 0x50, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, + 0x2f, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x63, 0x6f, 0x72, 0x65, 0x48, 0x00, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x88, 0x01, 0x01, + 0x12, 0x39, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x73, 0x74, 0x61, 0x6e, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x0a, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x62, + 0x6f, 0x64, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x6c, 0x65, + 0x6d, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x08, 0x0a, 0x06, 0x5f, + 0x73, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x5a, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x21, + 0x0a, 0x0c, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0x53, 0x63, 0x6f, 0x72, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x65, 0x6e, 0x61, 0x6c, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x07, 0x70, 0x65, 0x6e, 0x61, 0x6c, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, + 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, + 0x65, 0x22, 0x69, 0x0a, 0x0a, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, + 0x37, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x1f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x64, 0x65, + 0x70, 0x6c, 0x6f, 0x79, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, + 0x72, 0x65, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x8c, 0x01, 0x0a, + 0x0b, 0x50, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x2e, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x6c, + 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x45, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x2e, 0x76, + 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x76, 0x65, 0x50, 0x72, 0x6f, + 0x62, 0x6c, 0x65, 0x6d, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x76, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x8d, 0x01, 0x0a, 0x0a, + 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x68, 0x6f, + 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, + 0x6f, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x75, + 0x73, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x42, 0x0b, + 0x0a, 0x09, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x63, 0x0a, 0x12, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x62, 0x6c, 0x65, + 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0x15, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4a, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x50, + 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x32, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x62, 0x6c, + 0x65, 0x6d, 0x73, 0x22, 0x27, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x62, 0x6c, 0x65, + 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x46, 0x0a, 0x12, + 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x73, 0x74, 0x61, 0x6e, 0x74, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x52, 0x07, 0x70, 0x72, 0x6f, + 0x62, 0x6c, 0x65, 0x6d, 0x22, 0x23, 0x0a, 0x0d, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x10, 0x0a, 0x0e, 0x44, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x94, 0x01, 0x0a, 0x10, + 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x21, 0x0a, 0x1d, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, 0x4e, + 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x45, + 0x44, 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, 0x4e, + 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x49, + 0x4e, 0x47, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, + 0x4e, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, + 0x10, 0x03, 0x2a, 0x49, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x42, 0x4c, 0x45, 0x4d, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x42, 0x4c, 0x45, 0x4d, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x44, 0x45, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x32, 0x83, 0x02, + 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x57, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x73, + 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x73, 0x74, 0x61, 0x6e, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0a, 0x47, 0x65, 0x74, + 0x50, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x12, 0x20, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x73, + 0x74, 0x61, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x62, 0x6c, + 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, + 0x62, 0x6c, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x06, + 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x1c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x73, 0x74, 0x61, 0x6e, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x42, 0x4d, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x69, 0x63, 0x74, 0x73, 0x63, 0x2f, 0x69, 0x63, 0x74, 0x73, 0x63, 0x2d, 0x72, 0x65, + 0x67, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x70, 0x6b, + 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x73, 0x74, 0x61, 0x6e, 0x74, + 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_contestant_v1_problem_proto_rawDescOnce sync.Once + file_contestant_v1_problem_proto_rawDescData = file_contestant_v1_problem_proto_rawDesc +) + +func file_contestant_v1_problem_proto_rawDescGZIP() []byte { + file_contestant_v1_problem_proto_rawDescOnce.Do(func() { + file_contestant_v1_problem_proto_rawDescData = protoimpl.X.CompressGZIP(file_contestant_v1_problem_proto_rawDescData) + }) + return file_contestant_v1_problem_proto_rawDescData +} + +var file_contestant_v1_problem_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_contestant_v1_problem_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_contestant_v1_problem_proto_goTypes = []any{ + (DeploymentStatus)(0), // 0: contestant.v1.DeploymentStatus + (ProblemType)(0), // 1: contestant.v1.ProblemType + (*Problem)(nil), // 2: contestant.v1.Problem + (*Score)(nil), // 3: contestant.v1.Score + (*Deployment)(nil), // 4: contestant.v1.Deployment + (*ProblemBody)(nil), // 5: contestant.v1.ProblemBody + (*Connection)(nil), // 6: contestant.v1.Connection + (*DescriptiveProblem)(nil), // 7: contestant.v1.DescriptiveProblem + (*ListProblemsRequest)(nil), // 8: contestant.v1.ListProblemsRequest + (*ListProblemsResponse)(nil), // 9: contestant.v1.ListProblemsResponse + (*GetProblemRequest)(nil), // 10: contestant.v1.GetProblemRequest + (*GetProblemResponse)(nil), // 11: contestant.v1.GetProblemResponse + (*DeployRequest)(nil), // 12: contestant.v1.DeployRequest + (*DeployResponse)(nil), // 13: contestant.v1.DeployResponse +} +var file_contestant_v1_problem_proto_depIdxs = []int32{ + 3, // 0: contestant.v1.Problem.score:type_name -> contestant.v1.Score + 4, // 1: contestant.v1.Problem.deployment:type_name -> contestant.v1.Deployment + 5, // 2: contestant.v1.Problem.body:type_name -> contestant.v1.ProblemBody + 0, // 3: contestant.v1.Deployment.status:type_name -> contestant.v1.DeploymentStatus + 1, // 4: contestant.v1.ProblemBody.type:type_name -> contestant.v1.ProblemType + 7, // 5: contestant.v1.ProblemBody.descriptive:type_name -> contestant.v1.DescriptiveProblem + 6, // 6: contestant.v1.DescriptiveProblem.connection:type_name -> contestant.v1.Connection + 2, // 7: contestant.v1.ListProblemsResponse.problems:type_name -> contestant.v1.Problem + 2, // 8: contestant.v1.GetProblemResponse.problem:type_name -> contestant.v1.Problem + 8, // 9: contestant.v1.ProblemService.ListProblems:input_type -> contestant.v1.ListProblemsRequest + 10, // 10: contestant.v1.ProblemService.GetProblem:input_type -> contestant.v1.GetProblemRequest + 12, // 11: contestant.v1.ProblemService.Deploy:input_type -> contestant.v1.DeployRequest + 9, // 12: contestant.v1.ProblemService.ListProblems:output_type -> contestant.v1.ListProblemsResponse + 11, // 13: contestant.v1.ProblemService.GetProblem:output_type -> contestant.v1.GetProblemResponse + 13, // 14: contestant.v1.ProblemService.Deploy:output_type -> contestant.v1.DeployResponse + 12, // [12:15] is the sub-list for method output_type + 9, // [9:12] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_contestant_v1_problem_proto_init() } +func file_contestant_v1_problem_proto_init() { + if File_contestant_v1_problem_proto != nil { + return + } + file_contestant_v1_problem_proto_msgTypes[0].OneofWrappers = []any{} + file_contestant_v1_problem_proto_msgTypes[3].OneofWrappers = []any{ + (*ProblemBody_Descriptive)(nil), + } + file_contestant_v1_problem_proto_msgTypes[4].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_contestant_v1_problem_proto_rawDesc, + NumEnums: 2, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_contestant_v1_problem_proto_goTypes, + DependencyIndexes: file_contestant_v1_problem_proto_depIdxs, + EnumInfos: file_contestant_v1_problem_proto_enumTypes, + MessageInfos: file_contestant_v1_problem_proto_msgTypes, + }.Build() + File_contestant_v1_problem_proto = out.File + file_contestant_v1_problem_proto_rawDesc = nil + file_contestant_v1_problem_proto_goTypes = nil + file_contestant_v1_problem_proto_depIdxs = nil +} diff --git a/frontend/packages/proto/exports/contestant-v1.ts b/frontend/packages/proto/exports/contestant-v1.ts index 60e77520..8c075617 100644 --- a/frontend/packages/proto/exports/contestant-v1.ts +++ b/frontend/packages/proto/exports/contestant-v1.ts @@ -1,3 +1,4 @@ // Code generated by scripts/generate-exports.ts; DO NOT EDIT. export * from "../proto/contestant/v1/notice_pb.ts"; +export * from "../proto/contestant/v1/problem_pb.ts"; export * from "../proto/contestant/v1/viewer_pb.ts"; diff --git a/frontend/packages/proto/proto/contestant/v1/problem_pb.ts b/frontend/packages/proto/proto/contestant/v1/problem_pb.ts new file mode 100644 index 00000000..eef29f08 --- /dev/null +++ b/frontend/packages/proto/proto/contestant/v1/problem_pb.ts @@ -0,0 +1,394 @@ +// @generated by protoc-gen-es v2.2.3 with parameter "target=ts" +// @generated from file contestant/v1/problem.proto (package contestant.v1, syntax proto3) +/* eslint-disable */ + +import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; +import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file contestant/v1/problem.proto. + */ +export const file_contestant_v1_problem: GenFile = /*@__PURE__*/ + fileDesc("Chtjb250ZXN0YW50L3YxL3Byb2JsZW0ucHJvdG8SDWNvbnRlc3RhbnQudjEixgEKB1Byb2JsZW0SDAoEY29kZRgBIAEoCRINCgV0aXRsZRgCIAEoCRIRCgltYXhfc2NvcmUYAyABKAMSKAoFc2NvcmUYBCABKAsyFC5jb250ZXN0YW50LnYxLlNjb3JlSACIAQESLQoKZGVwbG95bWVudBgFIAEoCzIZLmNvbnRlc3RhbnQudjEuRGVwbG95bWVudBIoCgRib2R5GAYgASgLMhouY29udGVzdGFudC52MS5Qcm9ibGVtQm9keUIICgZfc2NvcmUiPQoFU2NvcmUSFAoMbWFya2VkX3Njb3JlGAEgASgDEg8KB3BlbmFsdHkYAiABKAMSDQoFc2NvcmUYAyABKAMiUwoKRGVwbG95bWVudBIvCgZzdGF0dXMYASABKA4yHy5jb250ZXN0YW50LnYxLkRlcGxveW1lbnRTdGF0dXMSFAoMcmVkZXBsb3lhYmxlGAIgASgIInkKC1Byb2JsZW1Cb2R5EigKBHR5cGUYASABKA4yGi5jb250ZXN0YW50LnYxLlByb2JsZW1UeXBlEjgKC2Rlc2NyaXB0aXZlGAIgASgLMiEuY29udGVzdGFudC52MS5EZXNjcmlwdGl2ZVByb2JsZW1IAEIGCgRib2R5Im0KCkNvbm5lY3Rpb24SEQoJaG9zdF9uYW1lGAEgASgJEgwKBGhvc3QYAiABKAkSEQoEdXNlchgDIAEoCUgAiAEBEhUKCHBhc3N3b3JkGAQgASgJSAGIAQFCBwoFX3VzZXJCCwoJX3Bhc3N3b3JkIlEKEkRlc2NyaXB0aXZlUHJvYmxlbRIMCgRib2R5GAEgASgJEi0KCmNvbm5lY3Rpb24YAiADKAsyGS5jb250ZXN0YW50LnYxLkNvbm5lY3Rpb24iFQoTTGlzdFByb2JsZW1zUmVxdWVzdCJAChRMaXN0UHJvYmxlbXNSZXNwb25zZRIoCghwcm9ibGVtcxgBIAMoCzIWLmNvbnRlc3RhbnQudjEuUHJvYmxlbSIhChFHZXRQcm9ibGVtUmVxdWVzdBIMCgRjb2RlGAEgASgJIj0KEkdldFByb2JsZW1SZXNwb25zZRInCgdwcm9ibGVtGAEgASgLMhYuY29udGVzdGFudC52MS5Qcm9ibGVtIh0KDURlcGxveVJlcXVlc3QSDAoEY29kZRgBIAEoCSIQCg5EZXBsb3lSZXNwb25zZSqUAQoQRGVwbG95bWVudFN0YXR1cxIhCh1ERVBMT1lNRU5UX1NUQVRVU19VTlNQRUNJRklFRBAAEh4KGkRFUExPWU1FTlRfU1RBVFVTX0RFUExPWUVEEAESHwobREVQTE9ZTUVOVF9TVEFUVVNfREVQTE9ZSU5HEAISHAoYREVQTE9ZTUVOVF9TVEFUVVNfRkFJTEVEEAMqSQoLUHJvYmxlbVR5cGUSHAoYUFJPQkxFTV9UWVBFX1VOU1BFQ0lGSUVEEAASHAoYUFJPQkxFTV9UWVBFX0RFU0NSSVBUSVZFEAEygwIKDlByb2JsZW1TZXJ2aWNlElcKDExpc3RQcm9ibGVtcxIiLmNvbnRlc3RhbnQudjEuTGlzdFByb2JsZW1zUmVxdWVzdBojLmNvbnRlc3RhbnQudjEuTGlzdFByb2JsZW1zUmVzcG9uc2USUQoKR2V0UHJvYmxlbRIgLmNvbnRlc3RhbnQudjEuR2V0UHJvYmxlbVJlcXVlc3QaIS5jb250ZXN0YW50LnYxLkdldFByb2JsZW1SZXNwb25zZRJFCgZEZXBsb3kSHC5jb250ZXN0YW50LnYxLkRlcGxveVJlcXVlc3QaHS5jb250ZXN0YW50LnYxLkRlcGxveVJlc3BvbnNlQsMBChFjb20uY29udGVzdGFudC52MUIMUHJvYmxlbVByb3RvUAFaS2dpdGh1Yi5jb20vaWN0c2MvaWN0c2MtcmVnYWxpYS9iYWNrZW5kL3BrZy9wcm90by9jb250ZXN0YW50L3YxO2NvbnRlc3RhbnR2MaICA0NYWKoCDUNvbnRlc3RhbnQuVjHKAg1Db250ZXN0YW50XFYx4gIZQ29udGVzdGFudFxWMVxHUEJNZXRhZGF0YeoCDkNvbnRlc3RhbnQ6OlYxYgZwcm90bzM"); + +/** + * @generated from message contestant.v1.Problem + */ +export type Problem = Message<"contestant.v1.Problem"> & { + /** + * 問題コード + * + * @generated from field: string code = 1; + */ + code: string; + + /** + * タイトル + * + * @generated from field: string title = 2; + */ + title: string; + + /** + * 最大得点 + * + * @generated from field: int64 max_score = 3; + */ + maxScore: bigint; + + /** + * @generated from field: optional contestant.v1.Score score = 4; + */ + score?: Score; + + /** + * @generated from field: contestant.v1.Deployment deployment = 5; + */ + deployment?: Deployment; + + /** + * @generated from field: contestant.v1.ProblemBody body = 6; + */ + body?: ProblemBody; +}; + +/** + * Describes the message contestant.v1.Problem. + * Use `create(ProblemSchema)` to create a new message. + */ +export const ProblemSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_contestant_v1_problem, 0); + +/** + * @generated from message contestant.v1.Score + */ +export type Score = Message<"contestant.v1.Score"> & { + /** + * 採点による得点 + * + * @generated from field: int64 marked_score = 1; + */ + markedScore: bigint; + + /** + * ペナルティによる減点 + * + * @generated from field: int64 penalty = 2; + */ + penalty: bigint; + + /** + * 最終的な得点 + * + * @generated from field: int64 score = 3; + */ + score: bigint; +}; + +/** + * Describes the message contestant.v1.Score. + * Use `create(ScoreSchema)` to create a new message. + */ +export const ScoreSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_contestant_v1_problem, 1); + +/** + * @generated from message contestant.v1.Deployment + */ +export type Deployment = Message<"contestant.v1.Deployment"> & { + /** + * @generated from field: contestant.v1.DeploymentStatus status = 1; + */ + status: DeploymentStatus; + + /** + * @generated from field: bool redeployable = 2; + */ + redeployable: boolean; +}; + +/** + * Describes the message contestant.v1.Deployment. + * Use `create(DeploymentSchema)` to create a new message. + */ +export const DeploymentSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_contestant_v1_problem, 2); + +/** + * @generated from message contestant.v1.ProblemBody + */ +export type ProblemBody = Message<"contestant.v1.ProblemBody"> & { + /** + * @generated from field: contestant.v1.ProblemType type = 1; + */ + type: ProblemType; + + /** + * @generated from oneof contestant.v1.ProblemBody.body + */ + body: { + /** + * @generated from field: contestant.v1.DescriptiveProblem descriptive = 2; + */ + value: DescriptiveProblem; + case: "descriptive"; + } | { case: undefined; value?: undefined }; +}; + +/** + * Describes the message contestant.v1.ProblemBody. + * Use `create(ProblemBodySchema)` to create a new message. + */ +export const ProblemBodySchema: GenMessage = /*@__PURE__*/ + messageDesc(file_contestant_v1_problem, 3); + +/** + * @generated from message contestant.v1.Connection + */ +export type Connection = Message<"contestant.v1.Connection"> & { + /** + * ホスト名 + * + * @generated from field: string host_name = 1; + */ + hostName: string; + + /** + * ホスト(IP アドレス or ドメイン) + * + * @generated from field: string host = 2; + */ + host: string; + + /** + * ユーザ + * + * @generated from field: optional string user = 3; + */ + user?: string; + + /** + * パスワード + * + * @generated from field: optional string password = 4; + */ + password?: string; +}; + +/** + * Describes the message contestant.v1.Connection. + * Use `create(ConnectionSchema)` to create a new message. + */ +export const ConnectionSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_contestant_v1_problem, 4); + +/** + * @generated from message contestant.v1.DescriptiveProblem + */ +export type DescriptiveProblem = Message<"contestant.v1.DescriptiveProblem"> & { + /** + * 問題文 + * + * @generated from field: string body = 1; + */ + body: string; + + /** + * 接続情報 + * + * @generated from field: repeated contestant.v1.Connection connection = 2; + */ + connection: Connection[]; +}; + +/** + * Describes the message contestant.v1.DescriptiveProblem. + * Use `create(DescriptiveProblemSchema)` to create a new message. + */ +export const DescriptiveProblemSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_contestant_v1_problem, 5); + +/** + * @generated from message contestant.v1.ListProblemsRequest + */ +export type ListProblemsRequest = Message<"contestant.v1.ListProblemsRequest"> & { +}; + +/** + * Describes the message contestant.v1.ListProblemsRequest. + * Use `create(ListProblemsRequestSchema)` to create a new message. + */ +export const ListProblemsRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_contestant_v1_problem, 6); + +/** + * @generated from message contestant.v1.ListProblemsResponse + */ +export type ListProblemsResponse = Message<"contestant.v1.ListProblemsResponse"> & { + /** + * @generated from field: repeated contestant.v1.Problem problems = 1; + */ + problems: Problem[]; +}; + +/** + * Describes the message contestant.v1.ListProblemsResponse. + * Use `create(ListProblemsResponseSchema)` to create a new message. + */ +export const ListProblemsResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_contestant_v1_problem, 7); + +/** + * @generated from message contestant.v1.GetProblemRequest + */ +export type GetProblemRequest = Message<"contestant.v1.GetProblemRequest"> & { + /** + * @generated from field: string code = 1; + */ + code: string; +}; + +/** + * Describes the message contestant.v1.GetProblemRequest. + * Use `create(GetProblemRequestSchema)` to create a new message. + */ +export const GetProblemRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_contestant_v1_problem, 8); + +/** + * @generated from message contestant.v1.GetProblemResponse + */ +export type GetProblemResponse = Message<"contestant.v1.GetProblemResponse"> & { + /** + * @generated from field: contestant.v1.Problem problem = 1; + */ + problem?: Problem; +}; + +/** + * Describes the message contestant.v1.GetProblemResponse. + * Use `create(GetProblemResponseSchema)` to create a new message. + */ +export const GetProblemResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_contestant_v1_problem, 9); + +/** + * @generated from message contestant.v1.DeployRequest + */ +export type DeployRequest = Message<"contestant.v1.DeployRequest"> & { + /** + * @generated from field: string code = 1; + */ + code: string; +}; + +/** + * Describes the message contestant.v1.DeployRequest. + * Use `create(DeployRequestSchema)` to create a new message. + */ +export const DeployRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_contestant_v1_problem, 10); + +/** + * @generated from message contestant.v1.DeployResponse + */ +export type DeployResponse = Message<"contestant.v1.DeployResponse"> & { +}; + +/** + * Describes the message contestant.v1.DeployResponse. + * Use `create(DeployResponseSchema)` to create a new message. + */ +export const DeployResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_contestant_v1_problem, 11); + +/** + * @generated from enum contestant.v1.DeploymentStatus + */ +export enum DeploymentStatus { + /** + * @generated from enum value: DEPLOYMENT_STATUS_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * 展開済み + * + * @generated from enum value: DEPLOYMENT_STATUS_DEPLOYED = 1; + */ + DEPLOYED = 1, + + /** + * 展開中 + * + * @generated from enum value: DEPLOYMENT_STATUS_DEPLOYING = 2; + */ + DEPLOYING = 2, + + /** + * 展開失敗 + * + * @generated from enum value: DEPLOYMENT_STATUS_FAILED = 3; + */ + FAILED = 3, +} + +/** + * Describes the enum contestant.v1.DeploymentStatus. + */ +export const DeploymentStatusSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_contestant_v1_problem, 0); + +/** + * @generated from enum contestant.v1.ProblemType + */ +export enum ProblemType { + /** + * @generated from enum value: PROBLEM_TYPE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: PROBLEM_TYPE_DESCRIPTIVE = 1; + */ + DESCRIPTIVE = 1, +} + +/** + * Describes the enum contestant.v1.ProblemType. + */ +export const ProblemTypeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_contestant_v1_problem, 1); + +/** + * @generated from service contestant.v1.ProblemService + */ +export const ProblemService: GenService<{ + /** + * @generated from rpc contestant.v1.ProblemService.ListProblems + */ + listProblems: { + methodKind: "unary"; + input: typeof ListProblemsRequestSchema; + output: typeof ListProblemsResponseSchema; + }, + /** + * @generated from rpc contestant.v1.ProblemService.GetProblem + */ + getProblem: { + methodKind: "unary"; + input: typeof GetProblemRequestSchema; + output: typeof GetProblemResponseSchema; + }, + /** + * @generated from rpc contestant.v1.ProblemService.Deploy + */ + deploy: { + methodKind: "unary"; + input: typeof DeployRequestSchema; + output: typeof DeployResponseSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_contestant_v1_problem, 0); + diff --git a/proto/contestant/v1/problem.proto b/proto/contestant/v1/problem.proto new file mode 100644 index 00000000..081f75ea --- /dev/null +++ b/proto/contestant/v1/problem.proto @@ -0,0 +1,95 @@ +syntax = "proto3"; + +package contestant.v1; + +option go_package = "github.com/ictsc/ictsc-regalia/backend/pkg/proto/contestant/v1;contestantv1"; + +message Problem { + // 問題コード + string code = 1; + // タイトル + string title = 2; + // 最大得点 + int64 max_score = 3; + + optional Score score = 4; + Deployment deployment = 5; + ProblemBody body = 6; +} + +message Score { + // 採点による得点 + int64 marked_score = 1; + // ペナルティによる減点 + int64 penalty = 2; + // 最終的な得点 + int64 score = 3; +} + +message Deployment { + DeploymentStatus status = 1; + bool redeployable = 2; +} + +enum DeploymentStatus { + DEPLOYMENT_STATUS_UNSPECIFIED = 0; + // 展開済み + DEPLOYMENT_STATUS_DEPLOYED = 1; + // 展開中 + DEPLOYMENT_STATUS_DEPLOYING = 2; + // 展開失敗 + DEPLOYMENT_STATUS_FAILED = 3; +} + +message ProblemBody { + ProblemType type = 1; + oneof body { + DescriptiveProblem descriptive = 2; + } +} + +enum ProblemType { + PROBLEM_TYPE_UNSPECIFIED = 0; + PROBLEM_TYPE_DESCRIPTIVE = 1; +} + +message Connection { + // ホスト名 + string host_name = 1; + // ホスト(IP アドレス or ドメイン) + string host = 2; + // ユーザ + optional string user = 3; + // パスワード + optional string password = 4; +} + +message DescriptiveProblem { + // 問題文 + string body = 1; + // 接続情報 + repeated Connection connection = 2; +} + +message ListProblemsRequest {} +message ListProblemsResponse { + repeated Problem problems = 1; +} + +message GetProblemRequest { + string code = 1; +} +message GetProblemResponse { + Problem problem = 1; +} + +message DeployRequest { + string code = 1; +} +message DeployResponse {} + +service ProblemService { + rpc ListProblems(ListProblemsRequest) returns (ListProblemsResponse); + rpc GetProblem(GetProblemRequest) returns (GetProblemResponse); + rpc Deploy(DeployRequest) returns (DeployResponse); +}