handlers

package
v0.0.0-...-65b6697 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const LogRequestBinaryPart = "binary_part"

Save Log Request binary part

View Source
const LogRequestJsonPart = "json_request_part"

Save Log Request part with json data

Variables

This section is empty.

Functions

func HTTPHandler

func HTTPHandler(f HTTPHandlerFunc) http.HandlerFunc

HTTPHandler handles HTTP requests

func JSONHandler

func JSONHandler(f RestHandlerFunc) http.HandlerFunc

JSONHandler is a handler for JSON response content type handlers

func NewMux

func NewMux(basePath string, client *gorp.Client, kvStore store.KVStore) http.Handler

NewMux creates new Mux/Controller

func ReadJSON

func ReadJSON(r io.Reader, s interface{}) error

ReadJSON reads and unmarshals JSON

Types

type HTTPHandlerFunc

type HTTPHandlerFunc func(w http.ResponseWriter, rq *http.Request) error

HTTPHandlerFunc is a handler func for JSON/REST handlers

type RestHandlerFunc

type RestHandlerFunc func(rq *http.Request) (interface{}, error)

RestHandlerFunc handles REST requests

type StatusErr

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

StatusErr describes HTTP status error

func NewStatusErr

func NewStatusErr(statusCode int, err error) *StatusErr

NewStatusErr creates new status error

func (*StatusErr) StackTrace

func (se *StatusErr) StackTrace() errors.StackTrace

StackTrace returns stack trace of an error

Jump to

Keyboard shortcuts

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