compat

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package compat provides wrapper functions that allow a simple usage of the jsonapi package together with the standard http package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseRequest

func ParseRequest(r *http.Request, prefix string) (*jsonapi.Request, error)

ParseRequest is a convenience method to parse a standard http.Request.

See: https://godoc.org/github.com/gonfire/jsonapi#ParseRequest.

func WriteError

func WriteError(w http.ResponseWriter, err error) error

WriteError is a convenience method to write to a standard http.ResponseWriter.

See: https://godoc.org/github.com/gonfire/jsonapi#WriteError.

func WriteErrorList

func WriteErrorList(w http.ResponseWriter, errors ...*jsonapi.Error) error

WriteErrorList is a convenience method to write to a standard http.ResponseWriter.

See: https://godoc.org/github.com/gonfire/jsonapi#WriteErrorList.

func WriteResource

func WriteResource(w http.ResponseWriter, status int, resource *jsonapi.Resource, links *jsonapi.DocumentLinks, included ...*jsonapi.Resource) error

WriteResource is a convenience method to write to a standard http.ResponseWriter.

See: https://godoc.org/github.com/gonfire/jsonapi#WriteResource.

func WriteResources

func WriteResources(w http.ResponseWriter, status int, resources []*jsonapi.Resource, links *jsonapi.DocumentLinks, included ...*jsonapi.Resource) error

WriteResources is a convenience method to write to a standard http.ResponseWriter.

See: https://godoc.org/github.com/gonfire/jsonapi#WriteResources.

func WriteResponse

func WriteResponse(res http.ResponseWriter, status int, doc *jsonapi.Document) error

WriteResponse is a convenience method to write to a standard http.ResponseWriter.

See: https://godoc.org/github.com/gonfire/jsonapi#WriteResponse.

Types

This section is empty.

Jump to

Keyboard shortcuts

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