handlers

package
v0.0.0-...-a0f3f1a Latest Latest
Warning

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

Go to latest
Published: May 17, 2016 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeRouterForHealthCheckHandler

func InitializeRouterForHealthCheckHandler(r *mux.Router, dynamoDB *dynamodb.DynamoDB)

InitializeRouterForHealthCheckHandler initiailizes a HealthCheckHandler on the given router

func InitializeRouterForSensorHandler

func InitializeRouterForSensorHandler(r *mux.Router, database db.DeviceManager)

InitializeRouterForSensorHandler initializes the handler on the given router

func InitializeRouterForSensorsDataRetrieval

func InitializeRouterForSensorsDataRetrieval(r *mux.Router, deviceManager db.DeviceManager, measurementsDatabase db.MeasurementsDatabase)

InitializeRouterForSensorsDataRetrieval creates a SensorReadingsHandler on the given router

Types

type GetSensorsResponse

type GetSensorsResponse struct {
	Sensors []*db.Sensor `json:"sensors"`
}

GetSensorsResponse has a set of sensors

type HealthCheckHandler

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

HealthCheckHandler represents a healthcheck instance

func NewHealthCheckHandler

func NewHealthCheckHandler(dynamoDB *dynamodb.DynamoDB) *HealthCheckHandler

NewHealthCheckHandler constructs a new HealthCheckHandler

func (*HealthCheckHandler) HealthCheck

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

HealthCheck performs a health-check

type SensorHandler

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

SensorHandler instance

func NewSensorHandler

func NewSensorHandler(database db.DeviceManager) *SensorHandler

NewSensorHandler creates a new SensorHandler

func (*SensorHandler) GetSensor

func (m *SensorHandler) GetSensor(resp http.ResponseWriter, req *http.Request)

GetSensor retrieves a sensor from the database

func (*SensorHandler) UpdateSensor

func (m *SensorHandler) UpdateSensor(resp http.ResponseWriter, req *http.Request)

UpdateSensor updates a sensor record in the database

type SensorReadingsHandler

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

SensorReadingsHandler instance for retrieving readings

func NewSensorReadingsHandler

func NewSensorReadingsHandler(deviceManager db.DeviceManager, measurementsDatabase db.MeasurementsDatabase) *SensorReadingsHandler

NewSensorReadingsHandler creates a new SensorReadingsHandler

func (*SensorReadingsHandler) GetLastSensorReadings

func (m *SensorReadingsHandler) GetLastSensorReadings(resp http.ResponseWriter, req *http.Request)

GetLastSensorReadings retrieves last sensor readings for sensors in an account

func (*SensorReadingsHandler) GetSensors

func (m *SensorReadingsHandler) GetSensors(resp http.ResponseWriter, req *http.Request)

GetSensors retrieves a list of sensors in an account

func (*SensorReadingsHandler) QueryForSensorReadings

func (m *SensorReadingsHandler) QueryForSensorReadings(resp http.ResponseWriter, req *http.Request)

QueryForSensorReadings retrieves readings for a sensor in an account matching certain criteria

type TokenVerificationMiddleware

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

TokenVerificationMiddleware with set of allowed tokens

func NewTokenVerificationMiddleware

func NewTokenVerificationMiddleware() *TokenVerificationMiddleware

NewTokenVerificationMiddleware constructs a new TokenVerificationMiddleware instance

func (*TokenVerificationMiddleware) Initialize

func (t *TokenVerificationMiddleware) Initialize()

Initialize will prepare the instance for use

func (*TokenVerificationMiddleware) Run

Run the middleware to verify the request includes a valid token

Jump to

Keyboard shortcuts

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