Documentation ¶
Index ¶
- func GetID(next http.Handler) http.Handler
- func GroupModel(creator *handler.Creator, model interface{}, endpoints ...EndpointType) chi.Router
- func GroupModelC(c *controller.Controller, creator *handler.Creator, model interface{}, ...) chi.Router
- func RouteModel(r chi.Router, creator *handler.Creator, model interface{}, ...)
- func RouteModelC(c *controller.Controller, r chi.Router, creator *handler.Creator, ...)
- type EndpointType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetID ¶
GetID is the middleware that stores the 'id' in the request context with the key specified in the `jsonapi-handler.IDKey`.
func GroupModel ¶
func GroupModel(creator *handler.Creator, model interface{}, endpoints ...EndpointType) chi.Router
GroupModel creates chi router group for given 'model' with provided 'endpoints' for the Default neuron Controller. By default all endpoints are set.
func GroupModelC ¶
func GroupModelC(c *controller.Controller, creator *handler.Creator, model interface{}, endpoints ...EndpointType) chi.Router
GroupModelC creates chi router group for given 'model' with provided 'endpoints' for given 'c' controller. By default all endpoints are set.
func RouteModel ¶
func RouteModel(r chi.Router, creator *handler.Creator, model interface{}, endpoints ...EndpointType)
RouteModel routes model endpoints for given 'r' chi Router. By default all endpoints are set.
func RouteModelC ¶
func RouteModelC(c *controller.Controller, r chi.Router, creator *handler.Creator, model interface{}, endpoints ...EndpointType)
RouteModelC routes model endpoints for given 'r' chi Router for given 'c' neuron controller. By default all endpoints are set.
Types ¶
type EndpointType ¶
type EndpointType int
const ( Create EndpointType = iota Get GetRelatedFields GetRelationships List Patch PatchRelationships Delete )
Click to show internal directories.
Click to hide internal directories.