Documentation ¶
Index ¶
- func InitializeRouterForHealthCheckHandler(r *mux.Router, dynamoDB *dynamodb.DynamoDB)
- func InitializeRouterForSensorHandler(r *mux.Router, database db.DeviceManager)
- func InitializeRouterForSensorsDataRetrieval(r *mux.Router, deviceManager db.DeviceManager, ...)
- type GetSensorsResponse
- type HealthCheckHandler
- type SensorHandler
- type SensorReadingsHandler
- type TokenVerificationMiddleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitializeRouterForHealthCheckHandler ¶
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 ¶
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 ¶
func (t *TokenVerificationMiddleware) Run(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
Run the middleware to verify the request includes a valid token