Help us shape the future of Go! Take the 2026 Go Developer Survey

notifychannel

package
v1.152.3 Latest Latest
Warning

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

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

Documentation

Overview

Package notifychannel persists the operator's notification channels: the PostgreSQL store behind notification.ChannelStore.

It sits beside notifyprefs and notifyqueue, and is the same kind of thing: one table, read and written through one contract. The transports a channel delivers over are internal/notification/notifypost, which this package does not import and does not know about.

Index

Constants

This section is empty.

Variables

View Source
var ErrChannelNotFound = errors.New("notifychannel: channel not found")

ErrChannelNotFound is returned by Get for a name no channel is stored under, and by the worker when a queued row names a channel the operator has since deleted.

Functions

This section is empty.

Types

type PostgresStore

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

PostgresStore implements notification.ChannelStore over the notification_channels table.

func NewPostgresStore

func NewPostgresStore(db *sql.DB) *PostgresStore

NewPostgresStore creates a PostgreSQL-backed channel store.

func (*PostgresStore) Delete

func (s *PostgresStore) Delete(ctx context.Context, name string) error

Delete removes a channel. Deleting an absent channel is not an error: the administrator asked for it to be gone and it is.

func (*PostgresStore) Get

Get returns one channel, or ErrChannelNotFound.

func (*PostgresStore) List

List returns every channel in name order.

func (*PostgresStore) Set

Set creates or replaces a channel. created_by is preserved on an update: the administrator who created a channel stays recorded when a later one edits it, which is what the settings card reports.

Jump to

Keyboard shortcuts

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