Documentation ¶
Index ¶
- Constants
- Variables
- func StackFrameToString(frame *HttpErrorStack) string
- func StackToString(stack []HttpErrorStack) string
- type ErrorHandler
- type Handler
- type HttpError
- func (err *HttpError) Error() string
- func (err *HttpError) GetCode() int
- func (err *HttpError) GetMessage() string
- func (err *HttpError) GetStack() []HttpErrorStack
- func (err *HttpError) GetStackString() string
- func (err *HttpError) GetTitle() string
- func (err *HttpError) Send(w http.ResponseWriter)
- type HttpErrorStack
- type Matcher
- type Mux
- func (s *Mux) AddRoute(route *Route)
- func (s *Mux) AddRoutes(routes []*Route)
- func (s *Mux) Listen(address, pubPath, prvPath string) error
- func (s *Mux) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Mux) SetDefaultHandler(handler Handler)
- func (s *Mux) SetErrorHandler(handler ErrorHandler)
- type Route
Constants ¶
View Source
const STACK_MAX_DEEP = 16
View Source
const STACK_SKIP = 3
Variables ¶
View Source
var METHODS = []string{"GET", "HEAD", "POST", "PUT", "PATCH", "DELETE"}
Functions ¶
func StackFrameToString ¶
func StackFrameToString(frame *HttpErrorStack) string
func StackToString ¶
func StackToString(stack []HttpErrorStack) string
Types ¶
type ErrorHandler ¶
type ErrorHandler func(e *HttpError, w http.ResponseWriter, r *http.Request)
type Handler ¶
type Handler func(w http.ResponseWriter, r *http.Request) error
Server const and types
type HttpError ¶
type HttpError struct {
// contains filtered or unexported fields
}
func NewHttpError ¶
func (*HttpError) GetMessage ¶
func (*HttpError) GetStack ¶
func (err *HttpError) GetStack() []HttpErrorStack
func (*HttpError) GetStackString ¶
func (*HttpError) Send ¶
func (err *HttpError) Send(w http.ResponseWriter)
type HttpErrorStack ¶
func GetCurrentStack ¶
func GetCurrentStack(skip, maxDeep int) []HttpErrorStack
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
Mux type and methods
func (*Mux) SetDefaultHandler ¶
func (*Mux) SetErrorHandler ¶
func (s *Mux) SetErrorHandler(handler ErrorHandler)
Click to show internal directories.
Click to hide internal directories.