server

package
v0.1.0-7360672 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DefaultPort is the default port number to listen on.
	DefaultPort = 80
	// DefaultBlockSize is the default size of i/o buffer in bytes.
	DefaultBlockSize = 10 * 1024
	// DefaultInactiveRequestTimeout is the default timeout for inactive requests. In particular, this sets a limit on how long the backend can wait before writing headers and the response status.
	DefaultInactiveRequestTimeout = 60 * time.Second
	// DefaultInactiveBackendTimeout is the default timeout for inactive backends.
	DefaultInactiveBackendTimeout = 30 * time.Minute
)

Variables

View Source
var (
	ErrMultipleClients  = errors.New("multiple clients trying to handle request ID")
	ErrRelayTimeout     = errors.New("timeout waiting for relay client to accept request")
	ErrNoRequest        = errors.New("no request received within timeout")
	ErrServerRestarting = errors.New("server is restarting")
	ErrInvalidRequestID = errors.New("duplicate or invalid request ID")
	ErrClosedInactivity = errors.New("closed due to inactivity")
)
View Source
var (
	ErrRequestPathTooShort     = errors.New("request path too short")
	ErrMissingServerNameHeader = errors.New("missing required header")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// Port number to listen on.
	Port int
	// BlockSize is the size of i/o buffer in bytes.
	BlockSize int
	// InactiveRequestTimeout is the timeout for inactive requests.
	InactiveRequestTimeout time.Duration
	// InactiveBackendTimeout is the timeout for inactive backends.
	InactiveBackendTimeout time.Duration
}

type RelayClientUnavailableError

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

func (*RelayClientUnavailableError) Error

type Server

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

func NewServer

func NewServer(conf Config) *Server

func (*Server) Start

func (s *Server) Start(ctx context.Context)

func (*Server) StartOnListener

func (s *Server) StartOnListener(ctx context.Context, ln net.Listener)

Jump to

Keyboard shortcuts

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