response

package
v0.0.0-...-30ca3a0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2014 License: BSD-3-Clause Imports: 2 Imported by: 9

Documentation

Index

Constants

View Source
const (
	ErrCodeUnknown   float32 = 0.0
	ErrCodeNotLogged float32 = 0.1
	ErrNoPermission  float32 = 0.2
)

Variables

This section is empty.

Functions

func BadRequestResponse

func BadRequestResponse(rw http.ResponseWriter, err *JSONErr)

func ErrorResponse

func ErrorResponse(rw http.ResponseWriter, sttCode int, err *JSONErr)

func ForbiddenResponse

func ForbiddenResponse(rw http.ResponseWriter, err *JSONErr)

func InternalErrorResponse

func InternalErrorResponse(rw http.ResponseWriter, err *JSONErr)

func UnauthorizedResponse

func UnauthorizedResponse(rw http.ResponseWriter, err *JSONErr)

Types

type JSONErr

type JSONErr struct {
	Code        float32
	Message     string
	Description string    `json:",omitempty"`
	StackStrace string    `json:",omitempty"`
	Errors      []JSONErr `json:",omitempty"`
}

JSONErr returned to the user an informative error json message

Jump to

Keyboard shortcuts

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