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: 0

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