Documentation
¶
Index ¶
- func HandleAccept(runners core.RunnerStore) http.HandlerFunc
- func HandleAuthentication(machines core.MachineStore) func(http.Handler) http.Handler
- func HandleJoin(machines core.MachineStore) http.HandlerFunc
- func HandleLeave(machines core.MachineStore) http.HandlerFunc
- func HandleLock(machines core.MachineStore) http.HandlerFunc
- func HandlePing(machines core.MachineStore) http.HandlerFunc
- func HandleRegister(runners core.RunnerStore, runnerz core.RunnerService) http.HandlerFunc
- func HandleRequest(scheduler core.Scheduler) http.HandlerFunc
- func HandleStarted(runners core.RunnerStore) http.HandlerFunc
- func HandleUnlock(machines core.MachineStore) http.HandlerFunc
- func HandleWatch(scheduler core.Scheduler) http.HandlerFunc
- func MachineFrom(ctx context.Context) (*core.Machine, bool)
- func WithMachine(parent context.Context, machine *core.Machine) context.Context
- type Server
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 ¶
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 ¶
MachineFrom returns the value of the machine key on the ctx
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