actions

package
v0.0.0-...-71b0d36 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TokenLength is device's token length
	TokenLength = 32
)

Variables

This section is empty.

Functions

func App

func App(debug bool, st store.Device) *echo.Echo

App creates new instance of Echo and configures it

func HealthzHandler

func HealthzHandler(c echo.Context) error

HealthzHandler shows server is up and running

Types

type DevicesHandler

type DevicesHandler struct {
	Store store.Device
}

DevicesHandler handles registered devices

func (DevicesHandler) Create

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

Create adds a device to the DB. This function is mapped to the path POST /devices

func (DevicesHandler) Destroy

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

Destroy deletes a device from the DB. This function is mapped to the path DELETE /devices/{device_id}

func (DevicesHandler) List

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

List gets all devices. This function is mapped to the path GET /devices

func (DevicesHandler) Refresh

func (v DevicesHandler) Refresh(c echo.Context) error

Refresh creates new device token. This function is mapped to the path GET /devices/{device_id}/refresh

func (DevicesHandler) Show

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

Show gets the data for one device. This function is mapped to the path GET /devices/{device_id}

func (DevicesHandler) Update

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

Update changes a device in the DB. This function is mapped to the path PUT /devices/{device_id}

Jump to

Keyboard shortcuts

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