web

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotFoundTemplate *template.Template

Functions

func InternalServerErrorHandler

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

func NewEndpoint

func NewEndpoint(s *Server, route route, Description string, serve func(w http.ResponseWriter, r *http.Request))

func NotFoundHandler

func NotFoundHandler(w http.ResponseWriter, r *http.Request, Routes map[route]*endpoint)

Types

type ErrorNotFound

type ErrorNotFound struct{}

func (ErrorNotFound) Error

func (n ErrorNotFound) Error() string

type Server

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

func NewServer

func NewServer() *Server

func (*Server) GetMux

func (s *Server) GetMux() *http.ServeMux

func (*Server) GetRouter

func (s *Server) GetRouter() map[route]*endpoint

func (*Server) RegisterEndpoint

func (s *Server) RegisterEndpoint(route route, Description string, handler func(w http.ResponseWriter, r *http.Request)) *Server

type TemplateNotFoundPageVars

type TemplateNotFoundPageVars struct {
	Routes map[route]*endpoint
}

Jump to

Keyboard shortcuts

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