errorpage

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultKeysForStatus

func DefaultKeysForStatus(code int) (titleKey, bodyKey string)

func IsAssetPath

func IsAssetPath(p string) bool

func WantsHTML

func WantsHTML(r *http.Request) bool

Types

type BufRW

type BufRW struct {
	W      http.ResponseWriter
	R      *http.Request
	Status int
	// contains filtered or unexported fields
}

func (*BufRW) Body

func (b *BufRW) Body() string

func (*BufRW) FlushToReal

func (b *BufRW) FlushToReal()

func (*BufRW) Header

func (b *BufRW) Header() http.Header

func (*BufRW) Write

func (b *BufRW) Write(p []byte) (int, error)

func (*BufRW) WriteHeader

func (b *BufRW) WriteHeader(code int)

type Config

type Config struct {
	Bypass        func(r *http.Request) bool
	Raw           func(r *http.Request) bool
	KeysForStatus func(code int) (titleKey, bodyKey string)
	Capture       func(r *http.Request) (*http.Request, func(*http.Request) *http.Request)
	PrepareRender func(w http.ResponseWriter, r *http.Request) *http.Request
	Render        func(w http.ResponseWriter, r *http.Request, data map[string]interface{})
	OnPanic       func(rec interface{})
}

func (Config) ErrorPage

func (c Config) ErrorPage(next http.Handler) http.Handler

func (Config) Recover

func (c Config) Recover(next http.Handler) http.Handler

Jump to

Keyboard shortcuts

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