rpc

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleAccept

func HandleAccept(runners core.RunnerStore) http.HandlerFunc

HandleAccept returns an http.HandlerFunc that processes an http.Request to accept ownership of the runner.

POST /rpc/v1/accept

func HandleAuthentication

func HandleAuthentication(machines core.MachineStore) func(http.Handler) http.Handler

HandleAuthentication returns an http.HandlerFunc middleware that authenticates the http.Request and errors if the machine cannot be authenticated.

func HandleJoin

func HandleJoin(machines core.MachineStore) http.HandlerFunc

HandleJoin returns an http.HandlerFunc that makes an http.Request to join the cluster.

POST /rpc/v1/join

func HandleLeave

func HandleLeave(machines core.MachineStore) http.HandlerFunc

HandleLeave returns an http.HandlerFunc that makes an http.Request to leave the cluster.

POST /rpc/v2/leave

func HandleLock

func HandleLock(machines core.MachineStore) http.HandlerFunc

HandleLock returns an http.HandlerFunc that processes an http.Request to lock machine resources for a runner

POST /rpc/v1/lock

func HandlePing

func HandlePing(machines core.MachineStore) http.HandlerFunc

HandlePing returns an http.HandlerFunc that makes an http.Request to ping the server and confirm connectivity.

POST /rpc/v1/ping

func HandleRegister

func HandleRegister(runners core.RunnerStore, runnerz core.RunnerService) http.HandlerFunc

HandleRegister returns an http.HandlerFunc that processes an http.Request to register GitHub runner and get details

POST /rpc/v1/register

func HandleRequest

func HandleRequest(scheduler core.Scheduler) http.HandlerFunc

HandleRequest returns an http.HandlerFunc that processes an http.Request to request a runner from the queue for execution.

POST /rpc/v1/request

func HandleStarted added in v0.2.0

func HandleStarted(runners core.RunnerStore) http.HandlerFunc

HandleStarted returns an http.HandlerFunc that processes an http.Request to indicate a runner as started.

POST /rpc/v1/started

func HandleUnlock

func HandleUnlock(machines core.MachineStore) http.HandlerFunc

HandleUnlock returns an http.HandlerFunc that processes an http.Request to unlock machine resources for a runner

POST /rpc/v1/lock

func HandleWatch

func HandleWatch(scheduler core.Scheduler) http.HandlerFunc

HandleWatch returns an http.HandlerFunc that accepts a blocking http.Request that watches a build for cancellation events.

GET /rpc/v1/watch

func MachineFrom

func MachineFrom(ctx context.Context) (*core.Machine, bool)

MachineFrom returns the value of the machine key on the ctx

func WithMachine

func WithMachine(parent context.Context, machine *core.Machine) context.Context

WithMachine returns a copy of parent in which the machine value is set

Types

type Server

type Server struct {
	Machines  core.MachineStore
	Runners   core.RunnerStore
	Runnerz   core.RunnerService
	Scheduler core.Scheduler
}

Server is a http.Handler exposing CIHub agent RPC interface over HTTP.

func New

func New(
	machines core.MachineStore,
	runners core.RunnerStore,
	runnerz core.RunnerService,
	scheduler core.Scheduler,
) Server

func (Server) Handler

func (s Server) Handler() http.Handler

Handler returns an http.Handler.

Jump to

Keyboard shortcuts

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