web

package
v0.4.11 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package web implements handlers and helpers for an application building a web server that uses the virtual package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler(h http.Handler, fsys fs.FS) http.Handler

ErrorHandler captures 404 and 500 errors and serves /404.html or /500.html from the file system.

func ExpiresHandler

func ExpiresHandler(h http.Handler, expires, staticExpires time.Duration) http.Handler

ExpiresHandler adds the expires header choosing expires for dynamic content and staticExpires for static content.

func HeaderHandler

func HeaderHandler(h http.Handler, headers map[string]string) http.Handler

HeaderHandler returns an http.Handler that adds the given headers to the response.

Types

This section is empty.

Jump to

Keyboard shortcuts

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