httputils

package
v0.0.0-...-6d4a0cd Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentTypeApplicationJSON = "application/json"
	HeaderContentType          = "Content-Type"
)

Variables

This section is empty.

Functions

func Close

func Close(closer io.Closer)

func RespondWithBody

func RespondWithBody(w http.ResponseWriter, status int, data interface{})

func RespondWithError

func RespondWithError(w http.ResponseWriter, status int, err error)

Types

type Error

type Error struct {
	Message string `json:"message"`
}

type ErrorResponse

type ErrorResponse struct {
	Errors []Error `json:"errors"`
}

Jump to

Keyboard shortcuts

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