api

package
v0.0.0-...-06858c0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BasePath         = "/api/v1"
	HealthPath       = "/health"
	VersionPath      = "/version"
	RunnersPath      = "/runners"
	EnvironmentsPath = "/execution-environments"
	StatisticsPath   = "/statistics"
)
View Source
const (
	ExecutePath             = "/execute"
	WebsocketPath           = "/websocket"
	UpdateFileSystemPath    = "/files"
	ListFileSystemRouteName = UpdateFileSystemPath + "_list"
	FileContentRawPath      = UpdateFileSystemPath + "/raw"
	ProvideRoute            = "provideRunner"
	DeleteRoute             = "deleteRunner"
	RunnerIDKey             = "runnerId"
	ExecutionIDKey          = "executionID"
	PathKey                 = "path"
	RecursiveKey            = "recursive"
	PrivilegedExecutionKey  = "privilegedExecution"
)

Variables

View Source
var ErrForbiddenCharacter = errors.New("use of forbidden character")
View Source
var ErrMissingURLParameter = errors.New("url parameter missing")
View Source
var ErrPrewarmingPoolDepleting = errors.New("the prewarming pool is depleting")
View Source
var ErrUnknownExecutionID = errors.New("execution id unknown")

Functions

func Health

func Health(manager environment.Manager) http.HandlerFunc

Health handles the health route. It responds that the server is alive. If it is not, the response won't reach the client.

func NewRouter

func NewRouter(runnerManager runner.Manager, environmentManager environment.ManagerHandler) *mux.Router

NewRouter returns a *mux.Router which can be used by the net/http package to serve the routes of our API. It always returns a router for the newest version of our API. We use gorilla/mux because it is more convenient than net/http, e.g. when extracting path parameters.

func StatisticsExecutionEnvironments

func StatisticsExecutionEnvironments(manager environment.Manager) http.HandlerFunc

StatisticsExecutionEnvironments handles the route for statistics about execution environments. It responds the prewarming pool size and the number of idle runners and used runners.

func Version

func Version(writer http.ResponseWriter, request *http.Request)

Version handles the version route. It responds the release information stored in the configuration.

Types

type EnvironmentController

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

func (*EnvironmentController) ConfigureRoutes

func (e *EnvironmentController) ConfigureRoutes(router *mux.Router)

type ExecutionEnvironmentsResponse

type ExecutionEnvironmentsResponse struct {
	ExecutionEnvironments []runner.ExecutionEnvironment `json:"executionEnvironments"`
}

type RunnerController

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

func (*RunnerController) ConfigureRoutes

func (r *RunnerController) ConfigureRoutes(router *mux.Router)

ConfigureRoutes configures a given router with the runner routes of our API.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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