[auto-commit] Generate codes
This commit is contained in:
1331
runner/v1/messages.pb.go
Normal file
1331
runner/v1/messages.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
160
runner/v1/runnerv1connect/services.connect.go
Normal file
160
runner/v1/runnerv1connect/services.connect.go
Normal file
@@ -0,0 +1,160 @@
|
||||
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
|
||||
//
|
||||
// Source: runner/v1/services.proto
|
||||
|
||||
package runnerv1connect
|
||||
|
||||
import (
|
||||
context "context"
|
||||
errors "errors"
|
||||
v1 "gitea.com/gitea/bots-proto-go/runner/v1"
|
||||
connect_go "github.com/bufbuild/connect-go"
|
||||
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_go.IsAtLeastVersion0_1_0
|
||||
|
||||
const (
|
||||
// RunnerServiceName is the fully-qualified name of the RunnerService service.
|
||||
RunnerServiceName = "runner.v1.RunnerService"
|
||||
)
|
||||
|
||||
// RunnerServiceClient is a client for the runner.v1.RunnerService service.
|
||||
type RunnerServiceClient interface {
|
||||
// Register register a new runner in server.
|
||||
Register(context.Context, *connect_go.Request[v1.RegisterRequest]) (*connect_go.Response[v1.RegisterResponse], error)
|
||||
// FetchTask requests the next available task for execution.
|
||||
FetchTask(context.Context, *connect_go.Request[v1.FetchTaskRequest]) (*connect_go.Response[v1.FetchTaskResponse], error)
|
||||
// UpdateTask updates the task status.
|
||||
UpdateTask(context.Context, *connect_go.Request[v1.UpdateTaskRequest]) (*connect_go.Response[v1.UpdateTaskResponse], error)
|
||||
// UpdateLog uploads log of the task.
|
||||
UpdateLog(context.Context, *connect_go.Request[v1.UpdateLogRequest]) (*connect_go.Response[v1.UpdateLogResponse], error)
|
||||
}
|
||||
|
||||
// NewRunnerServiceClient constructs a client for the runner.v1.RunnerService 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 NewRunnerServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) RunnerServiceClient {
|
||||
baseURL = strings.TrimRight(baseURL, "/")
|
||||
return &runnerServiceClient{
|
||||
register: connect_go.NewClient[v1.RegisterRequest, v1.RegisterResponse](
|
||||
httpClient,
|
||||
baseURL+"/runner.v1.RunnerService/Register",
|
||||
opts...,
|
||||
),
|
||||
fetchTask: connect_go.NewClient[v1.FetchTaskRequest, v1.FetchTaskResponse](
|
||||
httpClient,
|
||||
baseURL+"/runner.v1.RunnerService/FetchTask",
|
||||
opts...,
|
||||
),
|
||||
updateTask: connect_go.NewClient[v1.UpdateTaskRequest, v1.UpdateTaskResponse](
|
||||
httpClient,
|
||||
baseURL+"/runner.v1.RunnerService/UpdateTask",
|
||||
opts...,
|
||||
),
|
||||
updateLog: connect_go.NewClient[v1.UpdateLogRequest, v1.UpdateLogResponse](
|
||||
httpClient,
|
||||
baseURL+"/runner.v1.RunnerService/UpdateLog",
|
||||
opts...,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
// runnerServiceClient implements RunnerServiceClient.
|
||||
type runnerServiceClient struct {
|
||||
register *connect_go.Client[v1.RegisterRequest, v1.RegisterResponse]
|
||||
fetchTask *connect_go.Client[v1.FetchTaskRequest, v1.FetchTaskResponse]
|
||||
updateTask *connect_go.Client[v1.UpdateTaskRequest, v1.UpdateTaskResponse]
|
||||
updateLog *connect_go.Client[v1.UpdateLogRequest, v1.UpdateLogResponse]
|
||||
}
|
||||
|
||||
// Register calls runner.v1.RunnerService.Register.
|
||||
func (c *runnerServiceClient) Register(ctx context.Context, req *connect_go.Request[v1.RegisterRequest]) (*connect_go.Response[v1.RegisterResponse], error) {
|
||||
return c.register.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// FetchTask calls runner.v1.RunnerService.FetchTask.
|
||||
func (c *runnerServiceClient) FetchTask(ctx context.Context, req *connect_go.Request[v1.FetchTaskRequest]) (*connect_go.Response[v1.FetchTaskResponse], error) {
|
||||
return c.fetchTask.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// UpdateTask calls runner.v1.RunnerService.UpdateTask.
|
||||
func (c *runnerServiceClient) UpdateTask(ctx context.Context, req *connect_go.Request[v1.UpdateTaskRequest]) (*connect_go.Response[v1.UpdateTaskResponse], error) {
|
||||
return c.updateTask.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// UpdateLog calls runner.v1.RunnerService.UpdateLog.
|
||||
func (c *runnerServiceClient) UpdateLog(ctx context.Context, req *connect_go.Request[v1.UpdateLogRequest]) (*connect_go.Response[v1.UpdateLogResponse], error) {
|
||||
return c.updateLog.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// RunnerServiceHandler is an implementation of the runner.v1.RunnerService service.
|
||||
type RunnerServiceHandler interface {
|
||||
// Register register a new runner in server.
|
||||
Register(context.Context, *connect_go.Request[v1.RegisterRequest]) (*connect_go.Response[v1.RegisterResponse], error)
|
||||
// FetchTask requests the next available task for execution.
|
||||
FetchTask(context.Context, *connect_go.Request[v1.FetchTaskRequest]) (*connect_go.Response[v1.FetchTaskResponse], error)
|
||||
// UpdateTask updates the task status.
|
||||
UpdateTask(context.Context, *connect_go.Request[v1.UpdateTaskRequest]) (*connect_go.Response[v1.UpdateTaskResponse], error)
|
||||
// UpdateLog uploads log of the task.
|
||||
UpdateLog(context.Context, *connect_go.Request[v1.UpdateLogRequest]) (*connect_go.Response[v1.UpdateLogResponse], error)
|
||||
}
|
||||
|
||||
// NewRunnerServiceHandler 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 NewRunnerServiceHandler(svc RunnerServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {
|
||||
mux := http.NewServeMux()
|
||||
mux.Handle("/runner.v1.RunnerService/Register", connect_go.NewUnaryHandler(
|
||||
"/runner.v1.RunnerService/Register",
|
||||
svc.Register,
|
||||
opts...,
|
||||
))
|
||||
mux.Handle("/runner.v1.RunnerService/FetchTask", connect_go.NewUnaryHandler(
|
||||
"/runner.v1.RunnerService/FetchTask",
|
||||
svc.FetchTask,
|
||||
opts...,
|
||||
))
|
||||
mux.Handle("/runner.v1.RunnerService/UpdateTask", connect_go.NewUnaryHandler(
|
||||
"/runner.v1.RunnerService/UpdateTask",
|
||||
svc.UpdateTask,
|
||||
opts...,
|
||||
))
|
||||
mux.Handle("/runner.v1.RunnerService/UpdateLog", connect_go.NewUnaryHandler(
|
||||
"/runner.v1.RunnerService/UpdateLog",
|
||||
svc.UpdateLog,
|
||||
opts...,
|
||||
))
|
||||
return "/runner.v1.RunnerService/", mux
|
||||
}
|
||||
|
||||
// UnimplementedRunnerServiceHandler returns CodeUnimplemented from all methods.
|
||||
type UnimplementedRunnerServiceHandler struct{}
|
||||
|
||||
func (UnimplementedRunnerServiceHandler) Register(context.Context, *connect_go.Request[v1.RegisterRequest]) (*connect_go.Response[v1.RegisterResponse], error) {
|
||||
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("runner.v1.RunnerService.Register is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedRunnerServiceHandler) FetchTask(context.Context, *connect_go.Request[v1.FetchTaskRequest]) (*connect_go.Response[v1.FetchTaskResponse], error) {
|
||||
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("runner.v1.RunnerService.FetchTask is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedRunnerServiceHandler) UpdateTask(context.Context, *connect_go.Request[v1.UpdateTaskRequest]) (*connect_go.Response[v1.UpdateTaskResponse], error) {
|
||||
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("runner.v1.RunnerService.UpdateTask is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedRunnerServiceHandler) UpdateLog(context.Context, *connect_go.Request[v1.UpdateLogRequest]) (*connect_go.Response[v1.UpdateLogResponse], error) {
|
||||
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("runner.v1.RunnerService.UpdateLog is not implemented"))
|
||||
}
|
||||
110
runner/v1/services.pb.go
Normal file
110
runner/v1/services.pb.go
Normal file
@@ -0,0 +1,110 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc (unknown)
|
||||
// source: runner/v1/services.proto
|
||||
|
||||
package runnerv1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
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)
|
||||
)
|
||||
|
||||
var File_runner_v1_services_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_runner_v1_services_proto_rawDesc = []byte{
|
||||
0x0a, 0x18, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x72, 0x75, 0x6e, 0x6e,
|
||||
0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x18, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2f, 0x76, 0x31,
|
||||
0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32,
|
||||
0xb7, 0x02, 0x0a, 0x0d, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x12, 0x45, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1a, 0x2e,
|
||||
0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74,
|
||||
0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x72, 0x75, 0x6e, 0x6e,
|
||||
0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x09, 0x46, 0x65, 0x74, 0x63,
|
||||
0x68, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1b, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76,
|
||||
0x31, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x46,
|
||||
0x65, 0x74, 0x63, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b,
|
||||
0x12, 0x1c, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64,
|
||||
0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d,
|
||||
0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74,
|
||||
0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
|
||||
0x48, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x12, 0x1b, 0x2e, 0x72,
|
||||
0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c,
|
||||
0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x72, 0x75, 0x6e, 0x6e,
|
||||
0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x95, 0x01, 0x0a, 0x0d, 0x63, 0x6f,
|
||||
0x6d, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x53, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69,
|
||||
0x74, 0x65, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x65, 0x61, 0x2f, 0x62, 0x6f,
|
||||
0x74, 0x73, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x67, 0x6f, 0x2f, 0x72, 0x75, 0x6e, 0x6e,
|
||||
0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x76, 0x31, 0xa2, 0x02,
|
||||
0x03, 0x52, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x56, 0x31,
|
||||
0xca, 0x02, 0x09, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x15, 0x52,
|
||||
0x75, 0x6e, 0x6e, 0x65, 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61,
|
||||
0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x3a, 0x3a, 0x56,
|
||||
0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var file_runner_v1_services_proto_goTypes = []interface{}{
|
||||
(*RegisterRequest)(nil), // 0: runner.v1.RegisterRequest
|
||||
(*FetchTaskRequest)(nil), // 1: runner.v1.FetchTaskRequest
|
||||
(*UpdateTaskRequest)(nil), // 2: runner.v1.UpdateTaskRequest
|
||||
(*UpdateLogRequest)(nil), // 3: runner.v1.UpdateLogRequest
|
||||
(*RegisterResponse)(nil), // 4: runner.v1.RegisterResponse
|
||||
(*FetchTaskResponse)(nil), // 5: runner.v1.FetchTaskResponse
|
||||
(*UpdateTaskResponse)(nil), // 6: runner.v1.UpdateTaskResponse
|
||||
(*UpdateLogResponse)(nil), // 7: runner.v1.UpdateLogResponse
|
||||
}
|
||||
var file_runner_v1_services_proto_depIdxs = []int32{
|
||||
0, // 0: runner.v1.RunnerService.Register:input_type -> runner.v1.RegisterRequest
|
||||
1, // 1: runner.v1.RunnerService.FetchTask:input_type -> runner.v1.FetchTaskRequest
|
||||
2, // 2: runner.v1.RunnerService.UpdateTask:input_type -> runner.v1.UpdateTaskRequest
|
||||
3, // 3: runner.v1.RunnerService.UpdateLog:input_type -> runner.v1.UpdateLogRequest
|
||||
4, // 4: runner.v1.RunnerService.Register:output_type -> runner.v1.RegisterResponse
|
||||
5, // 5: runner.v1.RunnerService.FetchTask:output_type -> runner.v1.FetchTaskResponse
|
||||
6, // 6: runner.v1.RunnerService.UpdateTask:output_type -> runner.v1.UpdateTaskResponse
|
||||
7, // 7: runner.v1.RunnerService.UpdateLog:output_type -> runner.v1.UpdateLogResponse
|
||||
4, // [4:8] is the sub-list for method output_type
|
||||
0, // [0:4] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_runner_v1_services_proto_init() }
|
||||
func file_runner_v1_services_proto_init() {
|
||||
if File_runner_v1_services_proto != nil {
|
||||
return
|
||||
}
|
||||
file_runner_v1_messages_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_runner_v1_services_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_runner_v1_services_proto_goTypes,
|
||||
DependencyIndexes: file_runner_v1_services_proto_depIdxs,
|
||||
}.Build()
|
||||
File_runner_v1_services_proto = out.File
|
||||
file_runner_v1_services_proto_rawDesc = nil
|
||||
file_runner_v1_services_proto_goTypes = nil
|
||||
file_runner_v1_services_proto_depIdxs = nil
|
||||
}
|
||||
Reference in New Issue
Block a user