Documentation ¶
Index ¶
- type AccessorGroup
- func (accessorGroup *AccessorGroup) GetAllBuildings() ([]Building, error)
- func (accessorGroup *AccessorGroup) GetAllDevices() ([]Device, error)
- func (accessorGroup *AccessorGroup) GetAllRooms() ([]Room, error)
- func (AccessorGroup *AccessorGroup) GetAudioInformationForDevices(devices []Device) ([]Device, error)
- func (accessorGroup *AccessorGroup) GetBuildingByID(id int) (Building, error)
- func (accessorGroup *AccessorGroup) GetBuildingByShortname(shortname string) (Building, error)
- func (accessorGroup *AccessorGroup) GetDeviceByBuildingAndRoomAndName(buildingShortname string, roomName string, deviceName string) (Device, error)
- func (accessorGroup *AccessorGroup) GetDeviceCommandsByBuildingAndRoomAndName(buildingShortname string, roomName string, deviceName string) ([]Command, error)
- func (accessorGroup *AccessorGroup) GetDevicePortsByBuildingAndRoomAndName(buildingShortname string, roomName string, deviceName string) ([]Port, error)
- func (accessorGroup *AccessorGroup) GetDevicesByBuildingAndRoom(buildingShortname string, roomName string) ([]Device, error)
- func (accessorGroup *AccessorGroup) GetDevicesByBuildingAndRoomAndRole(buildingShortname string, roomName string, roleName string) ([]Device, error)
- func (accessorGroup *AccessorGroup) GetDevicesByQuery(query string, parameters ...interface{}) ([]Device, error)
- func (accessorGroup *AccessorGroup) GetDevicesByRoleAndType(deviceRole string, deviceType string) ([]Device, error)
- func (AccessorGroup *AccessorGroup) GetDisplayInformationForDevices(devices []Device) ([]Device, error)
- func (AccessorGroup *AccessorGroup) GetPowerStatesByDeviceID(deviceID int) ([]string, error)
- func (accessorGroup *AccessorGroup) GetRoomByBuildingAndName(buildingShortname string, name string) (Room, error)
- func (accessorGroup *AccessorGroup) GetRoomByID(id int) (Room, error)
- func (accessorGroup *AccessorGroup) GetRoomsByBuilding(building int) ([]Room, error)
- func (accessorGroup *AccessorGroup) MakeBuilding(name string, shortname string) (Building, error)
- func (accessorGroup *AccessorGroup) MakeDevice(name string, address string, buildingShortname string, roomName string, ...) (Device, error)
- func (accessorGroup *AccessorGroup) MakeRoom(name string, buildingShortname string, vlan int) (Room, error)
- func (accessorGroup *AccessorGroup) Open(dataSourceName string)
- func (accessorGroup *AccessorGroup) PutDeviceAttributeByDeviceAndRoomAndBuilding(building string, room string, device string, attribute string, ...) (Device, error)
- type Building
- type Command
- type Device
- type DeviceRequest
- type Endpoint
- type Port
- type Room
- type RoomRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessorGroup ¶
AccessorGroup holds all configuration for the accessors.
func (*AccessorGroup) GetAllBuildings ¶
func (accessorGroup *AccessorGroup) GetAllBuildings() ([]Building, error)
GetAllBuildings returns a list of buildings from the database
func (*AccessorGroup) GetAllDevices ¶
func (accessorGroup *AccessorGroup) GetAllDevices() ([]Device, error)
GetAllDevices returns a list of devices from the database
func (*AccessorGroup) GetAllRooms ¶
func (accessorGroup *AccessorGroup) GetAllRooms() ([]Room, error)
GetAllRooms returns a list of rooms from the database
func (*AccessorGroup) GetAudioInformationForDevices ¶
func (AccessorGroup *AccessorGroup) GetAudioInformationForDevices(devices []Device) ([]Device, error)
func (*AccessorGroup) GetBuildingByID ¶
func (accessorGroup *AccessorGroup) GetBuildingByID(id int) (Building, error)
GetBuildingByID returns a building from the database by ID
func (*AccessorGroup) GetBuildingByShortname ¶
func (accessorGroup *AccessorGroup) GetBuildingByShortname(shortname string) (Building, error)
GetBuildingByShortname returns a building from the database by shortname
func (*AccessorGroup) GetDeviceByBuildingAndRoomAndName ¶
func (*AccessorGroup) GetDeviceCommandsByBuildingAndRoomAndName ¶
func (*AccessorGroup) GetDevicePortsByBuildingAndRoomAndName ¶
func (*AccessorGroup) GetDevicesByBuildingAndRoom ¶
func (accessorGroup *AccessorGroup) GetDevicesByBuildingAndRoom(buildingShortname string, roomName string) ([]Device, error)
func (*AccessorGroup) GetDevicesByBuildingAndRoomAndRole ¶
func (*AccessorGroup) GetDevicesByQuery ¶
func (accessorGroup *AccessorGroup) GetDevicesByQuery(query string, parameters ...interface{}) ([]Device, error)
GetDevicesByQuery is a function that abstracts some of the execution and extraction of data from the database when we're looking for responses based on the COMPLETE device struct. The function MAY have the WHERE clause passed in to limit the devices found. The function MAY have any JOIN clauses necessary to the WEHRE Clause not included in the base query. JOIN statements in the base query: JOIN Rooms on Devices.roomID = Rooms.RoomID JOIN Buildings on Rooms.buildingID = Buildings.buildingID JOIN DeviceTypes on Devices.typeID = DeviceTypes.deviceTypeID If empty string is passed in no WHERE clause will be appended, and thus all devices will be returned.
Flow -> Find all devices based on the clause passed in
-> For each device found find the Ports -> For each device found find the Commands
Examples of valid parameters. Example 1: `JOIN deviceRole on deviceRole.deviceID = Devices.deviceID JOIN DeviceRoleDefinition on DeviceRole.deviceRoleDefinitionID = DeviceRoleDefinition.deviceRoleDefinitionID WHERE DeviceRoleDefinition.name LIKE 'AudioIn'` Example 2: `WHERE Devices.RoomID = 1`
func (*AccessorGroup) GetDevicesByRoleAndType ¶
func (accessorGroup *AccessorGroup) GetDevicesByRoleAndType(deviceRole string, deviceType string) ([]Device, error)
func (*AccessorGroup) GetDisplayInformationForDevices ¶
func (AccessorGroup *AccessorGroup) GetDisplayInformationForDevices(devices []Device) ([]Device, error)
func (*AccessorGroup) GetPowerStatesByDeviceID ¶
func (AccessorGroup *AccessorGroup) GetPowerStatesByDeviceID(deviceID int) ([]string, error)
func (*AccessorGroup) GetRoomByBuildingAndName ¶
func (accessorGroup *AccessorGroup) GetRoomByBuildingAndName(buildingShortname string, name string) (Room, error)
GetRoomByBuildingAndName returns a room from the database by building shortname and room name
func (*AccessorGroup) GetRoomByID ¶
func (accessorGroup *AccessorGroup) GetRoomByID(id int) (Room, error)
GetRoomByID returns a room from the database by ID
func (*AccessorGroup) GetRoomsByBuilding ¶
func (accessorGroup *AccessorGroup) GetRoomsByBuilding(building int) ([]Room, error)
GetRoomsByBuilding returns a room from the database by building
func (*AccessorGroup) MakeBuilding ¶
func (accessorGroup *AccessorGroup) MakeBuilding(name string, shortname string) (Building, error)
MakeBuilding adds a building to the database
func (*AccessorGroup) MakeDevice ¶
func (accessorGroup *AccessorGroup) MakeDevice(name string, address string, buildingShortname string, roomName string, protocol string) (Device, error)
MakeDevice adds a device to the database
func (*AccessorGroup) MakeRoom ¶
func (accessorGroup *AccessorGroup) MakeRoom(name string, buildingShortname string, vlan int) (Room, error)
MakeRoom adds a room to the database
func (*AccessorGroup) Open ¶
func (accessorGroup *AccessorGroup) Open(dataSourceName string)
Open creates a database connection and sets it in the struct
func (*AccessorGroup) PutDeviceAttributeByDeviceAndRoomAndBuilding ¶
type Device ¶
type Device struct { ID int `json:"id"` Name string `json:"name"` Address string `json:"address"` Input bool `json:"input"` Output bool `json:"output"` Building Building `json:"building"` Room Room `json:"room"` Type string `json:"type"` Power string `json:"power"` Blanked *bool `json:"blanked,omitempty"` Volume *int `json:"volume,omitempty"` Muted *bool `json:"muted,omitempty"` PowerStates []string `json:"powerstates,omitempty"` Responding bool `json:"responding"` Ports []Port `json:"ports,omitempty"` Commands []Command `json:"commands,omitempty"` }
type DeviceRequest ¶
type Room ¶
type Room struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Building Building `json:"building,omitempty"` CurrentVideoInput int `json:"currentVideoInput,omitempty"` CurrentAudioInput int `json:"currentAudioInput,omitempty"` CurrentVideoOutput int `json:"currentVideoOutput,omitempty"` CurrentAudioOutput int `json:"currentAudioOutput,omitempty"` Devices []Device `json:"devices,omitempty"` }