Documentation ¶
Index ¶
- Constants
- func NewRunnerServiceHandler(svc RunnerServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type RunnerServiceClient
- type RunnerServiceHandler
- type UnimplementedRunnerServiceHandler
- func (UnimplementedRunnerServiceHandler) Declare(context.Context, *connect.Request[v1.DeclareRequest]) (*connect.Response[v1.DeclareResponse], error)
- func (UnimplementedRunnerServiceHandler) FetchTask(context.Context, *connect.Request[v1.FetchTaskRequest]) (*connect.Response[v1.FetchTaskResponse], error)
- func (UnimplementedRunnerServiceHandler) Register(context.Context, *connect.Request[v1.RegisterRequest]) (*connect.Response[v1.RegisterResponse], error)
- func (UnimplementedRunnerServiceHandler) UpdateLog(context.Context, *connect.Request[v1.UpdateLogRequest]) (*connect.Response[v1.UpdateLogResponse], error)
- func (UnimplementedRunnerServiceHandler) UpdateTask(context.Context, *connect.Request[v1.UpdateTaskRequest]) (*connect.Response[v1.UpdateTaskResponse], error)
Constants ¶
const ( // RunnerServiceRegisterProcedure is the fully-qualified name of the RunnerService's Register RPC. RunnerServiceRegisterProcedure = "/runner.v1.RunnerService/Register" // RunnerServiceDeclareProcedure is the fully-qualified name of the RunnerService's Declare RPC. RunnerServiceDeclareProcedure = "/runner.v1.RunnerService/Declare" // RunnerServiceFetchTaskProcedure is the fully-qualified name of the RunnerService's FetchTask RPC. RunnerServiceFetchTaskProcedure = "/runner.v1.RunnerService/FetchTask" // RunnerServiceUpdateTaskProcedure is the fully-qualified name of the RunnerService's UpdateTask // RPC. RunnerServiceUpdateTaskProcedure = "/runner.v1.RunnerService/UpdateTask" // RunnerServiceUpdateLogProcedure is the fully-qualified name of the RunnerService's UpdateLog RPC. RunnerServiceUpdateLogProcedure = "/runner.v1.RunnerService/UpdateLog" )
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 (
// RunnerServiceName is the fully-qualified name of the RunnerService service.
RunnerServiceName = "runner.v1.RunnerService"
)
Variables ¶
This section is empty.
Functions ¶
func NewRunnerServiceHandler ¶
func NewRunnerServiceHandler(svc RunnerServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
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.
Types ¶
type RunnerServiceClient ¶
type RunnerServiceClient interface { // Register register a new runner in server. Register(context.Context, *connect.Request[v1.RegisterRequest]) (*connect.Response[v1.RegisterResponse], error) // Declare declare runner's version and labels to Gitea before starting fetching task. Declare(context.Context, *connect.Request[v1.DeclareRequest]) (*connect.Response[v1.DeclareResponse], error) // FetchTask requests the next available task for execution. FetchTask(context.Context, *connect.Request[v1.FetchTaskRequest]) (*connect.Response[v1.FetchTaskResponse], error) // UpdateTask updates the task status. UpdateTask(context.Context, *connect.Request[v1.UpdateTaskRequest]) (*connect.Response[v1.UpdateTaskResponse], error) // UpdateLog uploads log of the task. UpdateLog(context.Context, *connect.Request[v1.UpdateLogRequest]) (*connect.Response[v1.UpdateLogResponse], error) }
RunnerServiceClient is a client for the runner.v1.RunnerService service.
func NewRunnerServiceClient ¶
func NewRunnerServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) RunnerServiceClient
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).
type RunnerServiceHandler ¶
type RunnerServiceHandler interface { // Register register a new runner in server. Register(context.Context, *connect.Request[v1.RegisterRequest]) (*connect.Response[v1.RegisterResponse], error) // Declare declare runner's version and labels to Gitea before starting fetching task. Declare(context.Context, *connect.Request[v1.DeclareRequest]) (*connect.Response[v1.DeclareResponse], error) // FetchTask requests the next available task for execution. FetchTask(context.Context, *connect.Request[v1.FetchTaskRequest]) (*connect.Response[v1.FetchTaskResponse], error) // UpdateTask updates the task status. UpdateTask(context.Context, *connect.Request[v1.UpdateTaskRequest]) (*connect.Response[v1.UpdateTaskResponse], error) // UpdateLog uploads log of the task. UpdateLog(context.Context, *connect.Request[v1.UpdateLogRequest]) (*connect.Response[v1.UpdateLogResponse], error) }
RunnerServiceHandler is an implementation of the runner.v1.RunnerService service.
type UnimplementedRunnerServiceHandler ¶
type UnimplementedRunnerServiceHandler struct{}
UnimplementedRunnerServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedRunnerServiceHandler) Declare ¶ added in v0.3.0
func (UnimplementedRunnerServiceHandler) Declare(context.Context, *connect.Request[v1.DeclareRequest]) (*connect.Response[v1.DeclareResponse], error)
func (UnimplementedRunnerServiceHandler) FetchTask ¶
func (UnimplementedRunnerServiceHandler) FetchTask(context.Context, *connect.Request[v1.FetchTaskRequest]) (*connect.Response[v1.FetchTaskResponse], error)
func (UnimplementedRunnerServiceHandler) Register ¶
func (UnimplementedRunnerServiceHandler) Register(context.Context, *connect.Request[v1.RegisterRequest]) (*connect.Response[v1.RegisterResponse], error)
func (UnimplementedRunnerServiceHandler) UpdateLog ¶
func (UnimplementedRunnerServiceHandler) UpdateLog(context.Context, *connect.Request[v1.UpdateLogRequest]) (*connect.Response[v1.UpdateLogResponse], error)
func (UnimplementedRunnerServiceHandler) UpdateTask ¶
func (UnimplementedRunnerServiceHandler) UpdateTask(context.Context, *connect.Request[v1.UpdateTaskRequest]) (*connect.Response[v1.UpdateTaskResponse], error)