Versions in this module Expand all Collapse all v0 v0.4.0 Oct 15, 2026 Changes in this version + const MaxActionTitle + const MaxActions + const MaxBodyBytes + const MaxChannel + const MaxEnvironment + const MaxGroupKey + const MaxMessageBytes + const MaxMetadataKeys + const MaxMetadataString + const MaxSource + const MaxTTLSeconds + const MaxTitle + const MaxURLBytes + const MinTTLSeconds + const NoRetries + const Version + var ErrAuth = errors.New("honk: authentication failed") + var ErrConflict = errors.New("honk: idempotency conflict") + var ErrNetwork = errors.New("honk: network error") + var ErrQuota = errors.New("honk: quota or rate limit exceeded") + var ErrServer = errors.New("honk: server error") + var ErrTimeout = errors.New("honk: timeout") + var ErrValidation = errors.New("honk: invalid message") + var SeverityAliases = map[string]Severity + func EncodeMessage(m Message, defaults Defaults) ([]byte, error) + func NewIdempotencyKey() string + func Ptr[T any](v T) *T + type Accepted struct + Duplicate bool + ID string + ReceivedAt time.Time + type Action struct + Title string + URL string + type Backoff struct + Base time.Duration + Max time.Duration + type Category string + const CategoryAutomation + const CategoryBackups + const CategoryCustomers + const CategoryDeployments + const CategoryInfrastructure + const CategoryOther + const CategoryPayments + const CategoryPersonal + const CategorySales + const CategorySecurity + type Client struct + func FromEnv() (*Client, error) + func New(o Options) (*Client, error) + func (c *Client) Beep(ctx context.Context, title, message string, opts ...Option) (*Accepted, error) + func (c *Client) Blast(ctx context.Context, title, message string, opts ...Option) (*Accepted, error) + func (c *Client) Critical(ctx context.Context, title, message string, opts ...Option) (*Accepted, error) + func (c *Client) Error(ctx context.Context, title, message string, opts ...Option) (*Accepted, error) + func (c *Client) Honk(ctx context.Context, m Message, opts ...Option) (*Accepted, error) + func (c *Client) Info(ctx context.Context, title, message string, opts ...Option) (*Accepted, error) + func (c *Client) Light(ctx context.Context, title, message string, opts ...Option) (*Accepted, error) + func (c *Client) Long(ctx context.Context, title, message string, opts ...Option) (*Accepted, error) + func (c *Client) Loud(ctx context.Context, title, message string, opts ...Option) (*Accepted, error) + func (c *Client) Phew(ctx context.Context, groupKey, title, message string, opts ...Option) (*Accepted, error) + func (c *Client) Problem(ctx context.Context, groupKey, title, message string, opts ...Option) (*Accepted, error) + func (c *Client) Recovery(ctx context.Context, groupKey, title, message string, opts ...Option) (*Accepted, error) + func (c *Client) Send(ctx context.Context, m Message, opts ...Option) (*Accepted, error) + func (c *Client) Success(ctx context.Context, title, message string, opts ...Option) (*Accepted, error) + func (c *Client) Uhoh(ctx context.Context, groupKey, title, message string, opts ...Option) (*Accepted, error) + func (c *Client) Warning(ctx context.Context, title, message string, opts ...Option) (*Accepted, error) + type Defaults struct + Channel string + Environment string + Source string + type Error struct + Attempts int + Code string + Err error + Fields []FieldError + IdempotencyKey string + Kind Kind + Local bool + Message string + RequestID string + RetryAfter time.Duration + Status int + func (e *Error) Error() string + func (e *Error) Is(target error) bool + func (e *Error) Retryable() bool + func (e *Error) Unwrap() error + type EventType string + const EventTypeEvent + const EventTypeProblem + const EventTypeRecovery + type FieldError struct + Code string + Field string + Message string + type Kind string + const KindAuth + const KindCanceled + const KindConflict + const KindHTTP + const KindNetwork + const KindQuota + const KindServer + const KindTimeout + const KindValidation + type Message struct + Actions []Action + Category Category + Channel string + Environment string + EventType EventType + GroupKey string + ImageURL string + Message string + Metadata map[string]any + OccurredAt time.Time + Priority Priority + Severity Severity + Source string + SourceSequence *int64 + TTLSeconds int + Title string + URL string + type Option func(*sendCall) + func WithActions(actions ...Action) Option + func WithCategory(cat Category) Option + func WithChannel(ch string) Option + func WithEnvironment(e string) Option + func WithGroupKey(k string) Option + func WithIdempotencyKey(key string) Option + func WithImageURL(u string) Option + func WithMetadata(md map[string]any) Option + func WithOccurredAt(t time.Time) Option + func WithPriority(p Priority) Option + func WithSeverity(s Severity) Option + func WithSource(s string) Option + func WithSourceSequence(n int64) Option + func WithTTLSeconds(s int) Option + func WithURL(u string) Option + type Options struct + Backoff Backoff + Deadline time.Duration + Defaults Defaults + HTTPClient *http.Client + Key string + Retries int + SkipValidation bool + Timeout time.Duration + URL string + UserAgent string + func OptionsFromEnv() Options + type Priority string + const PriorityHigh + const PriorityLow + const PriorityNormal + const PriorityUrgent + type Severity string + const Beep + const Blast + const Light + const Long + const Loud + const SeverityCritical + const SeverityError + const SeverityInfo + const SeveritySuccess + const SeverityWarning + func ParseSeverity(s string) (Severity, bool)