util

package
v0.0.0-...-7aa43f1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStatusConflict            error = errors.New(fmt.Sprintf("%d: Conflict", http.StatusConflict))
	ErrStatusBadRequest          error = errors.New(fmt.Sprintf("%d: Bad Request", http.StatusBadRequest))
	ErrStatusInternalServerError error = errors.New(fmt.Sprintf("%d: Internal Server Error", http.StatusInternalServerError))
	ErrStatusNotFound            error = errors.New(fmt.Sprintf("%d: Not Found", http.StatusNotFound))
	ErrStatusUnauthorized        error = errors.New(fmt.Sprintf("%d: Unauthorized", http.StatusUnauthorized))
)
View Source
var HttpClient = http.DefaultClient

Functions

func MakeRequest

func MakeRequest(method, url string, entity interface{}) (*http.Response, error)

func MakeRequestWithMiddleware

func MakeRequestWithMiddleware(method, url string, entity interface{}, mid func(*http.Request)) (*http.Response, error)

func ProcessResponseBytes

func ProcessResponseBytes(r *http.Response, expectedStatus int) ([]byte, error)

func ProcessResponseEntity

func ProcessResponseEntity(r *http.Response, entity interface{}, expectedStatus int) error

Types

type UUID

type UUID [16]byte

func NewUUID

func NewUUID() *UUID

Create a new uuid v4

func (*UUID) String

func (u *UUID) String() string

Jump to

Keyboard shortcuts

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