feat: initial Beta 1 release
- soju raw connector with event playback and CHATHISTORY fallback - SQLite store with msgid de-dup and retention job - Mentions + Pushover + tuning; structured JSON logs - Summaries: concise, link-following, multi-line grouping - HTTP: /healthz, /ready, /tail, /trigger, /metrics - Docker: distroless, healthcheck, version metadata - Docs: README, CHANGELOG, compose
This commit is contained in:
commit
2954e85e7a
19 changed files with 1983 additions and 0 deletions
8
internal/notifier/notifier.go
Normal file
8
internal/notifier/notifier.go
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
package notifier
|
||||
|
||||
import "context"
|
||||
|
||||
type Notifier interface {
|
||||
Notify(ctx context.Context, title, message string) error
|
||||
}
|
||||
|
||||
39
internal/notifier/pushover.go
Normal file
39
internal/notifier/pushover.go
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
package notifier
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"github.com/gregdel/pushover"
|
||||
)
|
||||
|
||||
type PushoverNotifier struct {
|
||||
app *pushover.Pushover
|
||||
userKey string
|
||||
}
|
||||
|
||||
func NewPushover(userKey, apiToken string) *PushoverNotifier {
|
||||
return &PushoverNotifier{
|
||||
app: pushover.New(apiToken),
|
||||
userKey: userKey,
|
||||
}
|
||||
}
|
||||
|
||||
func (p *PushoverNotifier) Notify(ctx context.Context, title, message string) error {
|
||||
if p == nil || p.app == nil || p.userKey == "" {
|
||||
return nil
|
||||
}
|
||||
if len(message) > 1024 {
|
||||
message = message[:1024]
|
||||
}
|
||||
title = strings.TrimSpace(title)
|
||||
msg := &pushover.Message{
|
||||
Title: title,
|
||||
Message: message,
|
||||
}
|
||||
recipient := pushover.NewRecipient(p.userKey)
|
||||
_, err := p.app.SendMessage(msg, recipient)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue