pkg

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2017 License: Apache-2.0 Imports: 11 Imported by: 28 modules, 46 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound       = errors.New("Not found")
	ErrInvalidPayload = errors.New("Invalid payload")
	ErrUnauthorized   = errors.New("Unauthorized")
	ErrForbidden      = errors.New("Forbidden")
)

Functions

func AssertObjectKeysEqual

func AssertObjectKeysEqual(t *testing.T, a, b interface{}, keys ...string)

func AssertObjectKeysNotEqual

func AssertObjectKeysNotEqual(t *testing.T, a, b interface{}, keys ...string)

func GetErrorMessage

func GetErrorMessage(err error) string

func GetErrorStack

func GetErrorStack(err interface{}) string

func GetIP

func GetIP(req *http.Request) string

func HttpError

func HttpError(rw http.ResponseWriter, err error, code int)

func JoinURL

func JoinURL(host string, parts ...string) string

func LogError

func LogError(err error, code int)

func RequireObjectKeysEqual

func RequireObjectKeysEqual(t *testing.T, a, b interface{}, keys ...string)

func RequireObjectKeysNotEqual

func RequireObjectKeysNotEqual(t *testing.T, a, b interface{}, keys ...string)

func WriteCreatedJSON

func WriteCreatedJSON(rw http.ResponseWriter, url string, data interface{})

func WriteError

func WriteError(w http.ResponseWriter, err error)

func WriteIndentJSON

func WriteIndentJSON(rw http.ResponseWriter, data interface{})

func WriteJSON

func WriteJSON(rw http.ResponseWriter, data interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

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