Documentation ¶
Index ¶
Constants ¶
View Source
const ( // HeaderAcceptLanguage is the HTTP header name for accepted languages. HeaderAcceptLanguage = "Accept-Language" // HeaderContentLanguage is the HTTP header name for the content language. HeaderContentLanguage = "Content-Language" )
View Source
const ( // QueryParamPageTotal is the query parameter that marks to get total number instances / pages for the collection. QueryParamPageTotal string = "page[total]" // QueryParamLinks is the query parameter that marks to marshal object links. QueryParamLinks string = "links" )
Variables ¶
This section is empty.
Functions ¶
func AcceptMediaTypeMid ¶
func AcceptMediaTypeMid(next httprouter.Handle) httprouter.Handle
AcceptMediaTypeMid is the middleware that checks if the request contains Header "Accept: application/vnd.api+json".
func New ¶
func New(c *controller.Controller, cfg *config.Router, router ...*httprouter.Router) handler.Handler
New creates new jsonapi Handler.
func UnsupportedMediaTypeMid ¶
func UnsupportedMediaTypeMid(next httprouter.Handle) httprouter.Handle
UnsupportedMediaTypeMid is the middleware that checks if the request contains Header "Content-Type" with media type different then `application/vnd.api+json`
Types ¶
type Handler ¶
Handler is the neuron gateway handler that implements https://jsonapi.org server routes for neuron models.
func (*Handler) Router ¶
func (h *Handler) Router() *httprouter.Router
Router implements handler.Handler interface.
func (*Handler) SetModelRoutes ¶
SetModelRoutes sets the routes for the provided 'model'. The model must be registered within the controller provided in the Handler creator. Implements router.Router interface.
Click to show internal directories.
Click to hide internal directories.