notify

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 1 Imported by: 3 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package notify models transient notifications and TTL queues for viewkit applications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notification

type Notification struct {
	Title   string
	Message string
	Tone    Tone
}

func Negative

func Negative(title, message string) Notification

func Neutral

func Neutral(title, message string) Notification

func Note

func Note(tone Tone, title, message string) Notification

func Positive

func Positive(title, message string) Notification

func Warning

func Warning(title, message string) Notification

type Queue

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

func NewQueue

func NewQueue(cap int) *Queue

func (*Queue) Active

func (q *Queue) Active() bool

func (*Queue) Beat

func (q *Queue) Beat()

func (*Queue) Current

func (q *Queue) Current() (Notification, bool)

func (*Queue) Len

func (q *Queue) Len() int

func (*Queue) Prune added in v0.0.2

func (q *Queue) Prune(now time.Time)

func (*Queue) Push

func (q *Queue) Push(n Notification, ttl int)

func (*Queue) PushFor added in v0.0.2

func (q *Queue) PushFor(n Notification, now time.Time, d time.Duration)

func (*Queue) PushUntil added in v0.0.2

func (q *Queue) PushUntil(n Notification, expiry time.Time)

func (*Queue) Snapshot added in v0.0.2

func (q *Queue) Snapshot() []Notification

type Tone

type Tone int
const (
	TonePositive Tone = iota
	ToneNeutral
	ToneWarning
	ToneNegative
)

Jump to

Keyboard shortcuts

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