neko

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: BSD-2-Clause Imports: 11 Imported by: 0

README

neko

Web server utilities.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWideCastPatternNeeded = errors.New("handler needs wide cast pattern(end with `/`)")
View Source
var (
	ShutdownTimeout = time.Second * 5
)

Functions

func AllowCrossOrigin

func AllowCrossOrigin(h http.Handler) http.Handler

func BadRequest

func BadRequest(w http.ResponseWriter, message string)

func Block added in v0.6.3

func Block()

func Forbidden

func Forbidden(w http.ResponseWriter, message string)

func InternalServerError

func InternalServerError(w http.ResponseWriter, message string)

func InternalServerErrorHandler

func InternalServerErrorHandler(message string) http.Handler

func IsWideCast

func IsWideCast(pattern string) bool

func MethodNotAllowed

func MethodNotAllowed(w http.ResponseWriter, message string)

func PathResolver

func PathResolver(pattern string) (resolve func(pattern string) string)

func PermanentRedirect

func PermanentRedirect(w http.ResponseWriter, r *http.Request, u string)

func PermanentRedirectHandler

func PermanentRedirectHandler(u string) http.Handler

func RedirectHandler

func RedirectHandler(u string, code int) http.Handler

func RedirectToSlashHandler

func RedirectToSlashHandler() http.Handler

func StartServer

func StartServer(srv *http.Server, tls bool)

func StopServer

func StopServer(srv *http.Server)

func Teapot

func Teapot(w http.ResponseWriter, message string)

func TeapotHandler

func TeapotHandler(message string) http.Handler

func TemporaryRedirect

func TemporaryRedirect(w http.ResponseWriter, r *http.Request, u string)

func TemporaryRedirectHandler

func TemporaryRedirectHandler(u string) http.Handler

func TrimPattern

func TrimPattern(path string, pattern string) string

func Unauthorized

func Unauthorized(w http.ResponseWriter, message string)

func WarmupHandler added in v0.8.1

func WarmupHandler() http.Handler

Types

This section is empty.

Jump to

Keyboard shortcuts

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