runnerv1connect

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
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.

View Source
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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL