handlers

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handlers

type Handlers struct {
	Host           string
	DataService    avcontrol.DataService
	Logger         *zap.Logger
	State          avcontrol.StateGetSetter
	DriverRegistry avcontrol.DriverRegistry
}

Handlers acts as the http handler interface for the av-control-api.

func (*Handlers) GetRoomConfiguration

func (h *Handlers) GetRoomConfiguration(c *gin.Context)

GetRoomConfiguration gets the RoomConfig and returns it to the user as a JSON object in the body of an http response.

func (*Handlers) GetRoomHealth

func (h *Handlers) GetRoomHealth(c *gin.Context)

GetRoomHealth gets the health status of all the devices in the room and returns it to the user as a JSON object in the body of an http response.

func (*Handlers) GetRoomInfo

func (h *Handlers) GetRoomInfo(c *gin.Context)

GetRoomInfo gets the device info of all the devices in the room and returns it to the user as a JSON object in the body of an http response.

func (*Handlers) GetRoomState

func (h *Handlers) GetRoomState(c *gin.Context)

GetRoomState gets the state of the devices in the room and returns it to the user as a JSON object in the body of an http response.

func (*Handlers) Info

func (h *Handlers) Info(c *gin.Context)

Info returns a list of the registered drivers to the user in the body of an http response.

func (*Handlers) Log

func (h *Handlers) Log(c *gin.Context)

Log logs the start and end of client requests.

func (*Handlers) Proxy

func (h *Handlers) Proxy(c *gin.Context)

func (*Handlers) RequestID

func (h *Handlers) RequestID(c *gin.Context)

RequestID requests that the client provides an id to be used in log statements.

func (*Handlers) Room

func (h *Handlers) Room(c *gin.Context)

Room parses the http parameter "room", gets the appropriate room, and sets the parameter _cRoom.

func (*Handlers) SetRoomState

func (h *Handlers) SetRoomState(c *gin.Context)

SetRoomState parses a new room state from the user's http request and sets the room state accordingly. It returns an http response to the user with the status of the action.

func (*Handlers) Stats

func (h *Handlers) Stats(c *gin.Context)

Stats returns the status of the http server.

Jump to

Keyboard shortcuts

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