fusion

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRecordCount

func GetRecordCount() (int, error)

GetRecordCount returns an int representing how many records Fusion has (for circumventing pagination)

func GetRoomID

func GetRoomID(building string, room string) (string, error)

GetRoomID gets a room's Fusion ID from its building and room name

func HTTP

func HTTP(requestType string, url string) ([]byte, error)

HTTP is used to quickly make calls to the Crestron Fusion API and request a JSON response

func IsRoomAvailable

func IsRoomAvailable(symbolID string) (bool, error)

IsRoomAvailable returns a bool representing whether or not a room is available according to the Fusion "SYSTEM_POWER" symbol

func TranslateFusionSignalTypes

func TranslateFusionSignalTypes(signalType int) (string, error)

TranslateFusionSignalTypes takes Fusion-returned integer values and returns a human-readable string describing the signal's type

Types

type AllRooms

type AllRooms struct {
	Links []hateoas.Link `json:"links,omitempty"`
	Rooms []SlimRoom     `json:"rooms"`
}

AllRooms is a clean struct for returning room data

func GetAllRooms

func GetAllRooms() (AllRooms, error)

GetAllRooms returns all known rooms from the Crestron Fusion database

type FusionAllRooms

type FusionAllRooms struct {
	APIRooms []FusionRoom `json:"API_Rooms"`
}

FusionAllRooms is a struct for receiving responses from Fusion

type FusionAvailability

type FusionAvailability struct {
	RawValue bool
}

type FusionRecordCount

type FusionRecordCount struct {
	TotalRecords int `json:"TotalRecords"`
}

type FusionRoom

type FusionRoom struct {
	RoomName  string
	RoomID    string
	Hostname  string
	Address   string
	Building  string
	Room      string
	Available bool
	Symbols   []FusionSymbol
}

FusionRoom is a struct representing a room in Fusion's data

type FusionSignal

type FusionSignal struct {
	AttributeID   string
	AttributeName string
	AttributeType int // TODO: Map the int to a string (analog, digital, etc.) in the clean struct
	RawValue      string
}

type FusionSymbol

type FusionSymbol struct {
	ProcessorName string
	ConnectInfo   string
	SymbolID      string
	Signals       []FusionSignal
}

type Health

type Health struct {
	PingIn  bool
	PingOut bool
}

Health represents the results of various health checks run on each box

type Room

type Room struct {
	Links     []hateoas.Link `json:"links,omitempty"`
	Name      string         `json:"name"`
	ID        string
	Hostname  string   `json:"hostname,omitempty"`
	Address   string   `json:"address,omitempty"`
	Building  string   `json:"building,omitempty"`
	Room      string   `json:"room,omitempty"`
	Symbol    string   `json:"symbol,omitempty"`
	Available bool     `json:"available"`
	Health    Health   `json:"health"`
	Signals   []Signal `json:"signals"`
}

Room is a clean struct representing a room

func GetRoomByName

func GetRoomByName(roomName string) (Room, error)

GetRoomByName gets information about a room from only its name (EG: ASB+A203)

func GetRoomByNameAndBuilding

func GetRoomByNameAndBuilding(building string, room string) (Room, error)

GetRoomByNameAndBuilding gets information about a room using its supplied building and room number

type Signal

type Signal struct {
	Links []hateoas.Link `json:"links,omitempty"`
	Name  string         `json:"name"`
	ID    string
	Type  string `json:"type"`
	Value string `json:"value"`
}

type SlimRoom

type SlimRoom struct {
	Links   []hateoas.Link `json:"links,omitempty"`
	Name    string         `json:"name"`
	ID      string
	Signals []Signal `json:"signals,omitempty"`
}

SlimRoom is a clean struct representing a room

func GetAllSignalsByRoomAndBuilding

func GetAllSignalsByRoomAndBuilding(building string, room string) (SlimRoom, error)

func GetSignalByRoomAndBuilding

func GetSignalByRoomAndBuilding(building string, room string, signalName string) (SlimRoom, error)

Jump to

Keyboard shortcuts

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