Documentation
¶
Index ¶
- type Config
- type Daemon
- func (d *Daemon) CloseNotification(id uint32) *dbus.Error
- func (d *Daemon) CloseNotificationAsUser(id uint32) error
- func (d *Daemon) GetCapabilities() ([]string, *dbus.Error)
- func (d *Daemon) GetServerInformation() (string, string, string, string, *dbus.Error)
- func (d *Daemon) InvokeAction(id uint32, action_key string)
- func (d *Daemon) Notify(appName string, replacesID uint32, appIcon string, summary string, body string, ...) (uint32, *dbus.Error)
- func (d *Daemon) Start() error
- func (d *Daemon) Stop()
- type Notification
- type NotificationEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // LockFilePath is used for the file lock. // If empty, it defaults to $XDG_RUNTIME_DIR/notificationdaemon.lock or /tmp/notificationdaemon.lock. LockFilePath string // You can add additional customization options here. Capabilities []string }
Config allows customization of the daemon.
type Daemon ¶
type Daemon struct { Notifications map[uint32]Notification NotificationsChannel chan NotificationEvent Logger slog.Logger // contains filtered or unexported fields }
Daemon implements the org.freedesktop.Notifications interface.
func (*Daemon) CloseNotification ¶
CloseNotification implements the CloseNotification method.
func (*Daemon) CloseNotificationAsUser ¶
func (*Daemon) GetCapabilities ¶
GetCapabilities returns the capabilities supported by the notification server.
func (*Daemon) GetServerInformation ¶
GetServerInformation returns static information about the notification server.
func (*Daemon) InvokeAction ¶
func (*Daemon) Notify ¶
func (d *Daemon) Notify(appName string, replacesID uint32, appIcon string, summary string, body string, actions []string, hints map[string]dbus.Variant, expireTimeout int32) (uint32, *dbus.Error)
Notify implements the Notify method as defined in the Desktop Notifications spec. It creates (or replaces) a notification and returns its ID.
type Notification ¶
type Notification struct { ID uint32 AppName string AppIcon string Summary string Body string Actions []string Hints map[string]dbus.Variant ExpireTimeout int32 Timestamp time.Time }
Notification represents a notification event.
type NotificationEvent ¶
type NotificationEvent struct { Notification Notification Created bool Modified bool Deleted bool }
Click to show internal directories.
Click to hide internal directories.