Help us shape the future of Go! Take the 2026 Go Developer Survey

server

package
v0.251.11 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: AGPL-3.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShuttingDown added in v0.244.2

func ShuttingDown() <-chan struct{}

ShuttingDown returns a channel that is closed when the server starts shutting down.

func Start

func Start() error

Start will start the server.

Types

type Config

type Config struct {
	Port                 uint64          `koanf:"port"                 validate:"required,port"`
	Host                 string          `koanf:"host"                 validate:"required,hostname|fqdn|ip"`
	BaseURL              string          `koanf:"baseurl"              validate:"required,url"`
	CompressionLevel     int             `koanf:"compressionlevel"     validate:"number"`
	CompressionMimetypes []string        `koanf:"compressionmimetypes"`
	CertFile             string          `koanf:"crt"                  validate:"omitempty,file"`
	KeyFile              string          `koanf:"key"                  validate:"omitempty,file"`
	ReadTimeout          config.Duration `koanf:"readtimeout"`
	WriteTimeout         config.Duration `koanf:"writetimeout"`
	IdleTimeout          config.Duration `koanf:"idletimeout"`
	BlockSignup          bool            `koanf:"blocksignup"`
	BlockLogin           bool            `koanf:"blocklogin"`
	EnableOTEL           bool            `koanf:"enableotel"`
}

Config contains the server configuration options.

Directories

Path Synopsis
Package handlers contains chainable handlers/middleware for routing.
Package handlers contains chainable handlers/middleware for routing.
Package session contains methods and objects for managing user sessions.
Package session contains methods and objects for managing user sessions.

Jump to

Keyboard shortcuts

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