Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMalformedMsg = errors.New("malformed message") ErrNotANotification = errors.New("message is not a notification") )
Functions ¶
func TranslateHeaders ¶
func ValidateCriterion ¶
Types ¶
type NotiListener ¶
type NotiListener struct {
// contains filtered or unexported fields
}
func NewNotiListener ¶
func NewNotiListener(out chan *dbus.Message) (*NotiListener, error)
func (*NotiListener) Close ¶
func (n *NotiListener) Close() error
type Notification ¶
type Notification struct { Program string `json:"program"` Title string `json:"title"` Body string `json:"body"` Sender string `json:"sender"` Serial uint32 `json:"serial"` CreatedAt time.Time `json:"created_at"` }
func FromMessage ¶
func FromMessage(msg *dbus.Message) (*Notification, error)
func (*Notification) WithEscapedBody ¶
func (n *Notification) WithEscapedBody() *Notification
type Storage ¶
type Storage interface { // Append is the insertion method. Append(context.Context, *Notification) error // Query gives access to the saved methods. The list of criteria are // meant as and-concatenated. Query(context.Context, ...Criterion) ([]*Notification, error) // Prune should erase all the notifications from the store. Prune(context.Context) error }
Storage is append only and exposes a method to access the stored notifications, with optional filtering.
Click to show internal directories.
Click to hide internal directories.