api

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HealthCheckHandler

func HealthCheckHandler(w http.ResponseWriter, r *http.Request)

HealthCheckHandler is a simple health check

Types

type Api

type Api struct {
	Router *mux.Router
	DB     *models.Database
}

func (*Api) DeleteSensor

func (a *Api) DeleteSensor(w http.ResponseWriter, r *http.Request)

DeleteSensor from database

func (*Api) GetSensor

func (a *Api) GetSensor(w http.ResponseWriter, r *http.Request)

GetSensor by id

func (*Api) GetSensors

func (a *Api) GetSensors(w http.ResponseWriter, r *http.Request)

GetSensors retrive all sensorss from database

func (*Api) Initialize

func (a *Api) Initialize(dbUser, dbPass, dbHost, dbPort, dbName string)

func (*Api) InitializeRoutes

func (a *Api) InitializeRoutes()

func (*Api) PostSensor

func (a *Api) PostSensor(w http.ResponseWriter, r *http.Request)

PostSensor create new sensor

func (*Api) PutSensor

func (a *Api) PutSensor(w http.ResponseWriter, r *http.Request)

PutSensor update sensor info

func (*Api) Run

func (a *Api) Run()

Run database migrations and call server listen

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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