handlers

package
Version: v0.0.0-...-8fd38ff Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// NotFound - Basic 404 response
	NotFound = &Error{
		Message: "Resource not found",
		Code:    http.StatusNotFound,
	}

	// Unprocessable - 422 response type
	Unprocessable = &Error{
		Message: "Entity unprocessable",
		Code:    422,
	}
)

Functions

This section is empty.

Types

type Error

type Error struct {
	Message string `json:"_message"`
	Code    int    `json:"_code"`
}

Error - Http error

type Response

type Response struct {
	Data interface{}            `json:"data"`
	Meta map[string]interface{} `json:"_meta"`
}

Response - Http response

type ThingHandler

type ThingHandler struct {
	// contains filtered or unexported fields
}

ThingHandler - accepts ThingRepository as arg

func NewThingHandler

func NewThingHandler(datastore *models.ThingRepository) *ThingHandler

NewThingHandler - Creates new instance of ThingHandler

func (*ThingHandler) FindAll

func (handler *ThingHandler) FindAll(c echo.Context) error

FindAll - Handler to find all the things

func (*ThingHandler) Insert

func (handler *ThingHandler) Insert(c echo.Context) error

Insert - Handler to insert a thing

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL