Documentation ¶
Index ¶
- Constants
- Variables
- func NewPressRateLimiter(period time.Duration) *pressRateLimiter
- func SetLogLevel(lvl logrus.Level)
- type Accepter
- type ButtonConfig
- type Config
- type DashButtonEventHandler
- type Event
- type EventHandler
- type GeneralConfig
- type Listener
- type ListenerConfig
- type MQTTConfig
- type MQTTPublisher
- type Message
- type PCAPListener
- type Publisher
Constants ¶
View Source
const ( DefaultDashButtonTopicTemplate = "/buttonoff/{{.ButtonID}}/pressed" DefaultDashButtonPostPressSupressPeriod = time.Millisecond * 600 )
Variables ¶
Functions ¶
func NewPressRateLimiter ¶
func SetLogLevel ¶
Types ¶
type ButtonConfig ¶
type Config ¶
type Config struct { General GeneralConfig Listener ListenerConfig MQTT MQTTConfig Buttons []ButtonConfig }
type DashButtonEventHandler ¶
type DashButtonEventHandler struct {
// contains filtered or unexported fields
}
func NewDashButtonEventHandler ¶
func NewDashButtonEventHandler(general GeneralConfig, buttons []ButtonConfig, publisher Publisher) (*DashButtonEventHandler, error)
func (*DashButtonEventHandler) HandleEvent ¶
func (d *DashButtonEventHandler) HandleEvent(e Event) error
type EventHandler ¶
type GeneralConfig ¶
type Listener ¶
type Listener interface {
UseEventHandler(eh EventHandler) error
}
type ListenerConfig ¶
type ListenerConfig struct {
Interface string
}
type MQTTConfig ¶
type MQTTPublisher ¶
type MQTTPublisher struct {
// contains filtered or unexported fields
}
func NewMQTTPublisher ¶
func NewMQTTPublisher(conf MQTTConfig) (*MQTTPublisher, error)
func (*MQTTPublisher) Close ¶
func (mp *MQTTPublisher) Close() error
func (*MQTTPublisher) Publish ¶
func (mp *MQTTPublisher) Publish(msg Message) error
type PCAPListener ¶
type PCAPListener struct {
// contains filtered or unexported fields
}
func NewPCAPListener ¶
func NewPCAPListener(conf ListenerConfig) (*PCAPListener, error)
func (*PCAPListener) UseEventHandler ¶
func (pl *PCAPListener) UseEventHandler(eh EventHandler) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.