web

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

limit the amount of request data the web server will process

Index

Constants

This section is empty.

Variables

View Source
var (
	// WebMaxHeaderBytes is the largest number of header bytes accepted by
	// the webserver
	WebMaxHeaderBytes int = 1 << 17 // ~125k

	// ServerAddress is the default Server network address
	ServerAddress string = "127.0.0.1"

	// ServerPort is the default Server network port
	ServerPort string = "8000"

	// BaseURL is the base url for redirects, etc.
	BaseURL string = ""
)
View Source
var BodyLimitSize int64 = 1 << 17 // ~125k

BodyLimitSize is the largest amount of bytes the body of the request is permitted to accept

View Source
var (
	DirFS *fileSystem
)

development flags and static and template directory locations

View Source
var StaticFS embed.FS

Functions

func Health added in v0.4.14

func Health(w http.ResponseWriter, r *http.Request)

HealthCheck shows if the service is up

func Home

func Home(w http.ResponseWriter, r *http.Request)

Home is the home page

func NewFileSystem added in v0.6.0

func NewFileSystem(inDevelopment bool, tplDirPath, staticDirPath string) (*fileSystem, error)

NewFileSystem returns a new fileSystem

func PartialAddTrip added in v0.6.0

func PartialAddTrip(w http.ResponseWriter, r *http.Request)

PartialAddTrip adds a trip button row

func PartialDetailsHide added in v0.6.0

func PartialDetailsHide(w http.ResponseWriter, r *http.Request)

PartialDetailsHide shows the concise information details partial

func PartialDetailsShow added in v0.6.0

func PartialDetailsShow(w http.ResponseWriter, r *http.Request)

PartialDetailsShow shows an information details partial

func PartialNoContent added in v0.6.0

func PartialNoContent(w http.ResponseWriter, r *http.Request)

PartialNoContent returns no content

func PartialReport added in v0.6.0

func PartialReport(w http.ResponseWriter, r *http.Request)

PartialReport shows the results of a form submission in html

func Serve

func Serve(addr, port, baseURL string)

Serve runs the web server on the specified address and port mounted at baseURL

func SetupFS added in v0.6.1

func SetupFS()

SetupFSsetup the filesystem for templates or static files, depending on development (filesystem) or not (embedded)

func Trips

func Trips(w http.ResponseWriter, r *http.Request)

Trips is a POST endpoint for JSON queries, receiving json dates, turning this data into Holidays and then performing a calculation on the data, finally returning the json result.

Types

This section is empty.

Jump to

Keyboard shortcuts

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