rest

package
v0.0.0-...-1b74cd2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureJsonMime

func EnsureJsonMime(next http.Handler) http.Handler

ensure we get json data in the request

func EnsureUnmarshal

func EnsureUnmarshal(buffer io.ReadCloser, target interface{}, required []string) error

func EnsureUnmarshalBuffer

func EnsureUnmarshalBuffer(buffer []byte, target interface{}, required []string) error

func ErrorCode

func ErrorCode(w http.ResponseWriter, code int)

func ErrorWrapper

func ErrorWrapper(w http.ResponseWriter, err error) bool

func ShowError

func ShowError(w http.ResponseWriter, err error, code int) bool

func Unmarshal

func Unmarshal(buffer io.ReadCloser, target interface{}) error

Types

type RestError

type RestError struct {
	Code int
	Err  error
}

func (RestError) Error

func (this RestError) Error() string

Jump to

Keyboard shortcuts

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