Documentation ¶
Overview ¶
Example (DefaultEvent) ¶
package main import ( "encoding/json" "fmt" ) func must(err error) { if err != nil { log.Error(err.Error()) panic(err) } } func main() { var evt = defaultEvent{} evt.Speak.Template = `From "{{.From}}": {{.Message}}` must(evt.Speak.configure("test")) jevt := make(map[string]any) must(json.Unmarshal([]byte(`{ "From": "John Doe", "Message": "RoC Commander, o7!" }`), &jevt)) txt, args := evt.message(nil, jevt) fmt.Println(txt, args) }
Output: From "John Doe": RoC Commander, o7! []
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Speaker ¶
type Speaker struct { TTSExe string `yaml:"TTSExe"` Args []string `json:",omitempty" yaml:"Args"` Verbose bool `json:",omitempty" yaml:"Verbose"` Events map[string]any `yaml:"Events"` // contains filtered or unexported fields }
func (*Speaker) OnJournalEvent ¶ added in v0.6.4
func (spk *Speaker) OnJournalEvent(e watched.JounalEvent) error
func (*Speaker) OnStatusEvent ¶ added in v0.6.4
func (spk *Speaker) OnStatusEvent(e watched.StatusEvent) error
Click to show internal directories.
Click to hide internal directories.