controller

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildingController

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

func NewBuildingController

func NewBuildingController(router *mux.Router, r *render.Render, db *mgo.Database, roomCtrl *RoomController) *BuildingController

func (*BuildingController) CreateBuilding

func (ctrl *BuildingController) CreateBuilding(res http.ResponseWriter, req *http.Request)

func (*BuildingController) CreateRoom

func (ctrl *BuildingController) CreateRoom(res http.ResponseWriter, req *http.Request)

TODO move to RoomCtrl

func (*BuildingController) FindBuilding

func (ctrl *BuildingController) FindBuilding(res http.ResponseWriter, req *http.Request)

func (*BuildingController) FindBuildingId

func (ctrl *BuildingController) FindBuildingId(res http.ResponseWriter, req *http.Request)

func (*BuildingController) Register

func (ctrl *BuildingController) Register()

func (*BuildingController) Remove added in v0.3.0

func (ctrl *BuildingController) Remove(res http.ResponseWriter, req *http.Request)

func (*BuildingController) UpdateBuilding

func (ctrl *BuildingController) UpdateBuilding(res http.ResponseWriter, req *http.Request)

type ControllerError added in v0.3.0

type ControllerError struct {
	Status           string `json:"status"`
	DeveloperMessage string `json:"developerMessage"`
	UserMessage      string `json:"userMessage"`
	MoreInfo         string `json:"moreInfo"`
}

func NewControllerError added in v0.3.0

func NewControllerError(status string, developerMessage string, userMessage string, moreInfo string) *ControllerError

type DatapointController

type DatapointController struct {
	Datapoint *model.Datapoint
	// contains filtered or unexported fields
}

DatapointController represents the controller instance

func NewDatapointController

func NewDatapointController(router *mux.Router, r *render.Render, db *mgo.Database) *DatapointController

NewDatapointController creates the controller

func (*DatapointController) CalculateAndUpdateRoomOccupation

func (ctrl *DatapointController) CalculateAndUpdateRoomOccupation(o model.OccupationSensor, r model.Room) (info *mgo.ChangeInfo, err error)

func (*DatapointController) Register

func (ctrl *DatapointController) Register()

Register registers the routes with mux.Router

type HealthController

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

HealthController represents the controller instance

func NewHealthController

func NewHealthController(router *mux.Router, r *render.Render) *HealthController

NewHealthController creates the controller

func (*HealthController) Register

func (c *HealthController) Register()

Register registers the routes with mux.Router

type HubController

type HubController struct {
	Hub *model.Hub
	// contains filtered or unexported fields
}

HubController represents the controller instance

func NewHubController

func NewHubController(router *mux.Router, r *render.Render, db *mgo.Database) *HubController

NewHubController creates the controller

func (*HubController) Register

func (ctrl *HubController) Register()

Register registers the routes with mux.Router

type RoomController added in v0.3.0

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

func NewRoomController added in v0.3.0

func NewRoomController(router *mux.Router, r *render.Render, db *mgo.Database) *RoomController

func (*RoomController) Create added in v0.3.0

func (ctrl *RoomController) Create(res http.ResponseWriter, req *http.Request)

func (*RoomController) CreateRoster added in v0.3.0

func (ctrl *RoomController) CreateRoster(res http.ResponseWriter, req *http.Request)

func (*RoomController) Find added in v0.3.0

func (ctrl *RoomController) Find(res http.ResponseWriter, req *http.Request)

func (*RoomController) FindRoomID added in v0.3.0

func (ctrl *RoomController) FindRoomID(res http.ResponseWriter, req *http.Request)

func (*RoomController) Register added in v0.3.0

func (ctrl *RoomController) Register()

func (*RoomController) Update added in v0.3.0

func (ctrl *RoomController) Update(res http.ResponseWriter, req *http.Request)

type RoomLog

type RoomLog struct {
	ID         bson.ObjectId `json:"-" bson:"_id"`
	RoomID     bson.ObjectId `json:"-" bson:"room"`
	Occupation int           `json:"-" bson:"occupation"`
	Timestamp  time.Time     `json:"-" bson:"timestamp"`
}

type SensorController

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

HubController represents the controller instance

func NewSensorController

func NewSensorController(router *mux.Router, r *render.Render, db *mgo.Database) *SensorController

NewSensorController creates the controller

func (*SensorController) CreateDatapoints

func (ctrl *SensorController) CreateDatapoints(res http.ResponseWriter, req *http.Request)

CreateDatapoints saves datapoints to db Todo: this should be an alias method for the Create method in DatapointController

Jump to

Keyboard shortcuts

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