handler

package
v0.0.0-...-f87157e Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AboutHandler

func AboutHandler(c echo.Context) error

AboutHandler is a default handler to serve up memory of 18.20.

Types

type ThingsHandler

type ThingsHandler struct {
	Store store.Things
}

ThingsHandler handles existing things

func (ThingsHandler) Activation

func (v ThingsHandler) Activation(c echo.Context) error

Activation activates/deactivates thing. This function is mapped to the path GET /things/{thing_id}/{t:(?:activate|deactivate)}

func (ThingsHandler) Create

func (v ThingsHandler) Create(c echo.Context) error

Create adds a thing to the DB and its project. This function is mapped to the path POST /projects/{project_id}/things

func (ThingsHandler) Destroy

func (v ThingsHandler) Destroy(c echo.Context) error

Destroy deletes a thing from the DB and its project. This function is mapped to the path DELETE /things/{thing_id}

func (ThingsHandler) List

func (v ThingsHandler) List(c echo.Context) error

List gets all things. This function is mapped to the path GET /projects/{project_id}/things

func (ThingsHandler) Register

func (v ThingsHandler) Register(g *echo.Group)

Register registers the routes of things handler on given echo group

func (ThingsHandler) Show

func (v ThingsHandler) Show(c echo.Context) error

Show gets the data for one thing. This function is mapped to the path GET /things/{thing_id}

func (ThingsHandler) Update

func (v ThingsHandler) Update(c echo.Context) error

Update updates a thing information includes name, model and location. Please note that you must provide them all in update request even if you do not want to change it. This function is mapped to the path PUT /things/{thing_id}

Jump to

Keyboard shortcuts

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