Documentation
¶
Index ¶
- Constants
- Variables
- type Config
- func (c *Config) GetControllerList() []string
- func (c *Config) GetMQTTClientID() string
- func (c *Config) GetMQTTHost() string
- func (c *Config) GetMQTTPassword() string
- func (c *Config) GetMQTTPort() int
- func (c *Config) GetMQTTTopicPrefix() string
- func (c *Config) GetMQTTUsername() string
- func (c *Config) GetQueryInterval() time.Duration
- type FalconMessage
- type LightMessage
- type MQTTClient
- func (mc *MQTTClient) GetClient() MQTT.Client
- func (mc *MQTTClient) HandleSetLightMessage(slug string, payload LightMessage)
- func (mc *MQTTClient) OnClientConnect(client MQTT.Client)
- func (mc *MQTTClient) OnClientDisconnect(client MQTT.Client, err error)
- func (mc *MQTTClient) PublishOverlayModelStatus(slug string, model OverlayModel)
- func (mc *MQTTClient) Start(stateMachine *StateMachine) error
- func (mc *MQTTClient) Stop()
- type OnStateChange
- type OverlayModel
- type OverlayModelResponseData
- type QueryEngine
- type StateMachine
Constants ¶
View Source
const AutoDisconnectTime = 1000
View Source
const DefaultMQTTPort = 1883
View Source
const ExpectedColorCount = 3
View Source
const StateOff = "off"
View Source
const StateOn = "on"
Variables ¶
View Source
var ErrorIntervalGreaterThanZero = errors.New("query engine interval must be greater than 1 second")
View Source
var ErrorMustHaveOneIndex = errors.New("query engine controller list must have at least 1 index")
View Source
var ErrorStateMachineNil = errors.New("query engine state machine must not be nil")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Controllers []string QueryInterval time.Duration MQTTHost string MQTTPort int MQTTClientID string MQTTUsername string MQTTPassword string MQTTTopicPrefix string }
func (*Config) GetControllerList ¶
func (*Config) GetMQTTClientID ¶
func (*Config) GetMQTTHost ¶
func (*Config) GetMQTTPassword ¶
func (*Config) GetMQTTPort ¶
func (*Config) GetMQTTTopicPrefix ¶
func (*Config) GetMQTTUsername ¶
func (*Config) GetQueryInterval ¶
type FalconMessage ¶
type LightMessage ¶
type MQTTClient ¶
func NewMQTTClient ¶
func (*MQTTClient) GetClient ¶
func (mc *MQTTClient) GetClient() MQTT.Client
func (*MQTTClient) HandleSetLightMessage ¶
func (mc *MQTTClient) HandleSetLightMessage(slug string, payload LightMessage)
func (*MQTTClient) OnClientConnect ¶
func (mc *MQTTClient) OnClientConnect(client MQTT.Client)
func (*MQTTClient) OnClientDisconnect ¶
func (mc *MQTTClient) OnClientDisconnect(client MQTT.Client, err error)
func (*MQTTClient) PublishOverlayModelStatus ¶
func (mc *MQTTClient) PublishOverlayModelStatus(slug string, model OverlayModel)
func (*MQTTClient) Start ¶
func (mc *MQTTClient) Start(stateMachine *StateMachine) error
func (*MQTTClient) Stop ¶
func (mc *MQTTClient) Stop()
type OnStateChange ¶
type OnStateChange func(string, OverlayModel)
type OverlayModel ¶
type QueryEngine ¶
type QueryEngine struct { Controllers []string Interval time.Duration StateMachine *StateMachine Log *logrus.Entry // contains filtered or unexported fields }
func (*QueryEngine) Start ¶
func (qe *QueryEngine) Start() error
func (*QueryEngine) Stop ¶
func (qe *QueryEngine) Stop()
type StateMachine ¶
type StateMachine struct { OverlayModels syncmap.Map Callback OnStateChange }
func (*StateMachine) GenerateSlug ¶
func (sm *StateMachine) GenerateSlug(controller, name string) string
func (*StateMachine) UpdateBySlug ¶
func (sm *StateMachine) UpdateBySlug(slug, name string, state bool, rgbColor []int)
Click to show internal directories.
Click to hide internal directories.