webserver

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 41 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Dev bool

Dev, when set, disables HTTP caching of static assets: they are served with "no-cache" (still revalidated via ETag) so edits to the web client show up on a normal reload. Off in production.

View Source
var ErrIsDirectory = errors.New("is a directory")
View Source
var Insecure bool
View Source
var LetsEncrypt string

LetsEncrypt, when non-empty, is a comma-separated list of hostnames for which TLS certificates are obtained automatically from Let's Encrypt. Mutually exclusive with Insecure.

View Source
var StaticRoot string

Functions

func CheckOrigin

func CheckOrigin(w http.ResponseWriter, r *http.Request, admin bool) bool

CheckOrigin adds the CORS header to the reply. It obeys the AllowOrigin or AllowAdminOrigin field of the global configuration, depending on the value of admin. It returns true if the header was added, false otherwise.

func Serve

func Serve(address string, dataDir string) error

func SetTrustedProxies added in v0.3.1

func SetTrustedProxies(list string) error

SetTrustedProxies parses a comma-separated list of IP addresses and CIDR prefixes of trusted reverse proxies.

func Shutdown

func Shutdown()

Types

This section is empty.

Jump to

Keyboard shortcuts

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