server

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Reading requests and writing responses.

HTTP middlewares.

HTTP routes and handlers.

Package server provides an HTTP API for running code in a sandbox.

Index

Constants

View Source
const ShutdownTimeout = 3 * time.Second

The maximum duration of the server graceful shutdown.

Variables

This section is empty.

Functions

func NewDebug

func NewDebug() http.Handler

NewDebug creates HTTP routes for debugging.

func NewRouter

func NewRouter() http.Handler

NewRouter creates HTTP routes and handlers for them.

Types

type Server

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

A Server is an HTTP sandbox server.

func NewServer

func NewServer(host string, port int, handler http.Handler) *Server

NewServer creates a new Server.

func (*Server) Start

func (s *Server) Start()

Start starts the server.

func (*Server) Stop

func (s *Server) Stop() error

Stop stops the server.

Jump to

Keyboard shortcuts

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