handler

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2019 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	ListPagination   *pagination.Pagination
	CompressionLevel int

	Builder *builder.JSONAPI
	// contains filtered or unexported fields
}

Handler is the structure that allows the Gateway service to handle API CRUD operations

func New

func New(c *controller.Controller, cfg *config.Gateway, isup *i18n.Support) *Handler

New creates new route handler for the gateway

func (*Handler) HandleCreate

func (h *Handler) HandleCreate(m *mapping.ModelStruct) http.HandlerFunc

func (*Handler) HandleDelete

func (h *Handler) HandleDelete(m *mapping.ModelStruct) http.HandlerFunc

HandleDelete handles the delete query for the provided model

func (*Handler) HandleGet

func (h *Handler) HandleGet(m *mapping.ModelStruct) http.HandlerFunc

HandleGet handles the Get single object request

func (*Handler) HandleGetRelated

func (h *Handler) HandleGetRelated(m *mapping.ModelStruct) http.HandlerFunc

HandleGetRelated is the query handler function for getting the related object for the given model. The related field must be a relationship.

func (*Handler) HandleGetRelationship

func (h *Handler) HandleGetRelationship(m *mapping.ModelStruct) http.HandlerFunc

HandleGetRelationship returns the handler func to the get relationship scope for specified relationship field

func (*Handler) HandleList

func (h *Handler) HandleList(m *mapping.ModelStruct) http.HandlerFunc

HandleList returns the handler function that handles 'List' operation for the 'm' model.

func (*Handler) HandlePatch

func (h *Handler) HandlePatch(m *mapping.ModelStruct) http.HandlerFunc

HandlePatch handles the patch request for the models

func (*Handler) HandlePatchRelationship

func (h *Handler) HandlePatchRelationship(m *mapping.ModelStruct) http.HandlerFunc

HandlePatchRelationship handles the patch relationship API query

Jump to

Keyboard shortcuts

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