static

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package static provides a handler for serving static assets from an in-memory map.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Assets map[string]string

	// Index is the name of an entry in Assets that should be used if the request
	// path is empty (equivalent to requesting "/"). This is analogous to index
	// documents commonly used in webservers. If Index is empty, it will be
	// ignored.
	Index string

	// Default is the name of an entry in Assets that should be used if the
	// the requested path does not exist in Assets. This is useful for
	// delivering a common document (usually a frontend application script) that
	// handles URL-based state on the client side. If Default is empty, it will be
	// ignored.
	Default string
}

func (Handler) ServeHTTP

func (h Handler) ServeHTTP(rw http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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