server

package
v0.0.0-...-026be54 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPanicRecovery = errors.New("error handler recovering from panic()")
View Source
var ErrTemplateNotFound = errors.New("template not found")

Functions

func NewServer

func NewServer() http.Handler

func WithJSONLogging

func WithJSONLogging(next http.Handler, log zerolog.Logger) http.Handler

func WithTemplates

func WithTemplates(next http.Handler, t *Templates) http.Handler

Types

type ErrorHandler

type ErrorHandler func(http.ResponseWriter, int)

type Templates

type Templates struct {
	// contains filtered or unexported fields
}

func LoadTemplates

func LoadTemplates(folder fs.FS) *Templates

func (*Templates) Get

func (t *Templates) Get(name string) (*template.Template, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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