Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrQueueFull = errors.New("event delivery queue is full")
Functions ¶
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDispatcher ¶
func NewDispatcher(events []Event, queueSize int, onError func(error)) (*Dispatcher, error)
func (*Dispatcher) Notifications ¶
func (d *Dispatcher) Notifications() <-chan Delivery
func (*Dispatcher) ObserveLiveLine ¶
func (d *Dispatcher) ObserveLiveLine(line string)
func (*Dispatcher) Replace ¶
func (d *Dispatcher) Replace(events []Event) error
func (*Dispatcher) Sounds ¶
func (d *Dispatcher) Sounds() <-chan string
type Event ¶
type Event struct {
ID string `json:"id"`
Title string `json:"title"`
Active bool `json:"active"`
TriggerType TriggerType `json:"trigger_type"`
Pattern string `json:"pattern"`
ExactMatch bool `json:"exact_match,omitempty"`
SpellName string `json:"spell_name,omitempty"`
Notification string `json:"notification,omitempty"`
RequestPersistence bool `json:"request_persistence,omitempty"`
Sound string `json:"sound,omitempty"`
}
func (Event) NotificationText ¶
func (*Event) UnmarshalJSON ¶
type TriggerType ¶
type TriggerType string
const ( TriggerSpell TriggerType = "spell" TriggerText TriggerType = "text" TriggerRegexp TriggerType = "regexp" )
Click to show internal directories.
Click to hide internal directories.