notify

package
v1.0.260758 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() string

DefaultPath is ~/.config/ttypedesk/notifications.json

Types

type Notice

type Notice struct {
	ID      string    `json:"id"`
	Title   string    `json:"title"`
	Body    string    `json:"body"`
	Icon    string    `json:"icon"`
	Created time.Time `json:"created"`
	Source  string    `json:"source"`
	Read    bool      `json:"read"`
}

Notice is a system notification.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is the desktop-wide notification bus.

func New

func New() *Service

func (*Service) Configure

func (s *Service) Configure(persist bool, maxHist int)

Configure enables/disables disk history and reloads when turning persist on.

func (*Service) Dismiss

func (s *Service) Dismiss(id string)

func (*Service) DismissAll

func (s *Service) DismissAll()

func (*Service) List

func (s *Service) List() []Notice

func (*Service) Load

func (s *Service) Load()

func (*Service) MarkAllRead

func (s *Service) MarkAllRead()

func (*Service) Post

func (s *Service) Post(title, body, icon, source string) Notice

Post posts a notice and invokes subscribers.

func (*Service) Subscribe

func (s *Service) Subscribe(fn func(Notice))

func (*Service) Unread

func (s *Service) Unread() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL