urls

package
v0.0.0-...-269dea4 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2022 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package urls implements URL handler functions.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ItemMax is the maximum length of a stack item.
	ItemMax = 1_000

	// StackMax is the maximum number of items on a stack.
	StackMax = 10_000

	// StackTTL is the expiry time for a stack.
	StackTTL = 168 * time.Hour
)
View Source
var Index = template.Must(tpls.GetTemplate("index.txt"))

Index is the default index page template.

Functions

func DeleteToken

func DeleteToken(rwri http.ResponseWriter, rqst *http.Request)

DeleteToken deletes an existing user token.

func Get400

func Get400(rwri http.ResponseWriter, rqst *http.Request)

Get400 returns a 400 Bad Request error.

func Get404

func Get404(rwri http.ResponseWriter, rqst *http.Request)

Get404 returns a 404 Not Found error.

func Get405

func Get405(rwri http.ResponseWriter, rqst *http.Request)

Get405 returns a 405 Method Not Allowed error.

func Get413

func Get413(rwri http.ResponseWriter, rqst *http.Request)

Get413 returns a 413 Payload Too Large error.

func Get500

func Get500(rwri http.ResponseWriter, rqst *http.Request)

Get500 returns a 500 Internal Server Error error.

func GetIndex

func GetIndex(rwri http.ResponseWriter, rqst *http.Request)

GetIndex returns the index page template.

func GetPop

func GetPop(rwri http.ResponseWriter, rqst *http.Request)

GetPop removes and returns the top value on a token's stack.

func GetRegister

func GetRegister(rwri http.ResponseWriter, rqst *http.Request)

GetRegister returns a new API token.

func PostPush

func PostPush(rwri http.ResponseWriter, rqst *http.Request)

PostPush appends a value to the top of a token's stack.

func Router

func Router() *mux.Router

Router returns a new Router with registered URL functions.

Types

This section is empty.

Jump to

Keyboard shortcuts

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