Documentation
¶
Overview ¶
Package notify stores notifications for the human: rows in `notifications`, listed with `otag notify list` and acknowledged with `otag notify ack`. The daemon also shows new rows as macOS notifications (sent_at marks a row as handled by it).
Index ¶
- Constants
- func Ack(ctx context.Context, q db.Querier, ids []int64) (int64, error)
- func Add(ctx context.Context, q db.Querier, n New) (int64, error)
- func MarkSent(ctx context.Context, q db.Querier, id int64, channel string) error
- func Unread(ctx context.Context, q db.Querier) (int, error)
- type Filter
- type New
- type Notification
Constants ¶
const ( Info = "info" Warn = "warn" Error = "error" )
Severities.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type New ¶
type New struct {
ProjectID int64
TaskID string
RunID string
Kind string // e.g. run.crashed, run.stalled, run.unanswered, run.fallback, task.blocked
Severity string // default info
Title string
Body string
}
New describes a notification to add. ProjectID is required when TaskID or RunID is set.
type Notification ¶
type Notification struct {
ID int64 `json:"id"`
Project string `json:"project,omitempty"`
TaskID string `json:"task_id,omitempty"`
RunID string `json:"run_id,omitempty"`
Kind string `json:"kind"`
Severity string `json:"severity"`
Title string `json:"title"`
Body string `json:"body,omitempty"`
SentAt string `json:"sent_at,omitempty"`
ReadAt string `json:"read_at,omitempty"`
CreatedAt string `json:"created_at"`
}
Notification is a notifications row.