api

package
v0.0.0-...-6e00f06 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateTestHandler

type CreateTestHandler struct {
	// contains filtered or unexported fields
}

CreateTestHandler handles HTTP requests (POST only) to initiate tests for the worker cluster. This should be called from a CI.

func NewCreateTestHandler

func NewCreateTestHandler(r Runner, runnerTimeout time.Duration) *CreateTestHandler

NewCreateTestHandler builds a new CreateTestHandler.

func (*CreateTestHandler) ServeHTTP

func (h *CreateTestHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.

type Runner

type Runner interface {
	Run(t *sharedapi.Test) (int, error)
}

Runner tells the children to run tests.

type WorkerHandler

type WorkerHandler struct {
	// contains filtered or unexported fields
}

WorkerHandler is a websocket handler that waits for Worker connections. It keeps track of each connection, so that when a test is started (via Run()), it can tell each connection about the test.

func NewWorkerHandler

func NewWorkerHandler() *WorkerHandler

NewWorkerHandler builds a new WorkerHandler.

func (*WorkerHandler) ConnCount

func (s *WorkerHandler) ConnCount() int

func (*WorkerHandler) Run

func (s *WorkerHandler) Run(t *sharedapi.Test) (int, error)

Run writes the test information to each websocket connection.

func (*WorkerHandler) ServeHTTP

func (s *WorkerHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler. It only accepts websocket connections.

Jump to

Keyboard shortcuts

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