handler

package
v0.0.0-...-0791769 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PinOFF

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

PinON sets raspberry PIN to `LOW`

func PinON

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

PinON sets raspberry PIN to `HIGH`

func PinStatus

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

PinStatus retrieve raspberry pin status, (LOW/HIGH)

func ReadTemperature

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

ReadTemperature reads the temperature and humidity from a DHT sensor.

Types

type IntUser

type IntUser struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type LightHandler

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

func NewLightHandler

func NewLightHandler(db *gorm.DB) *LightHandler

func (*LightHandler) Add

func (*LightHandler) Detail

func (l *LightHandler) Detail(w http.ResponseWriter, r *http.Request)

func (*LightHandler) List

func (l *LightHandler) List(w http.ResponseWriter, r *http.Request)

type UserHandler

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

func NewUserHandler

func NewUserHandler(db *gorm.DB) *UserHandler

func (*UserHandler) CreateAdminUser

func (user *UserHandler) CreateAdminUser(password string)

func (*UserHandler) Login

func (user *UserHandler) Login(w http.ResponseWriter, r *http.Request)

Login takes care to check if a User can login

func (*UserHandler) Logout

func (user *UserHandler) Logout(w http.ResponseWriter, r *http.Request)

Logout endpoint is used to log a use out

func (*UserHandler) Profile

func (user *UserHandler) Profile(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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