event

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrQueueFull = errors.New("event delivery queue is full")

Functions

func NewID

func NewID() (string, error)

Types

type Delivery

type Delivery struct {
	Event            Event
	NotificationText string
}

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 (e Event) NotificationText() string

func (*Event) UnmarshalJSON

func (e *Event) UnmarshalJSON(data []byte) error

func (Event) Validate

func (e Event) Validate() error

type Matcher

type Matcher struct {
	// contains filtered or unexported fields
}

func Compile

func Compile(events []Event) (*Matcher, error)

func (*Matcher) Matches

func (m *Matcher) Matches(logLine string) []Event

type TriggerType

type TriggerType string
const (
	TriggerSpell  TriggerType = "spell"
	TriggerText   TriggerType = "text"
	TriggerRegexp TriggerType = "regexp"
)

Jump to

Keyboard shortcuts

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