notification

package
v0.84.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package notification adapts the shared helpers/notify inbox to ContentKit's authenticated user API. Persistence and lifecycle belong to helpers/notify; hosts own rendering and application-specific actions.

Index

Constants

View Source
const MaxPublish = 100

MaxPublish bounds one publish batch.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Pool           *pgxpool.Pool
	Schema, Tenant string
	Logger         *slog.Logger
}

Options selects the pool, ContentKit's schema and its tenant.

type Publication added in v0.83.0

type Publication struct {
	Notifications []notify.Input `json:"notifications"`
}

Publication is a batch of notices a host service publishes.

type Published added in v0.83.0

type Published struct {
	Items []notify.Item `json:"items"`
}

Published is each notice of a Publication as stored, in order, without those dropped for an erased recipient.

type Store

type Store struct {
	*postgres.Store
	// contains filtered or unexported fields
}

Store mounts a shared notification store as one ContentKit tenant's inbox. Embedded methods accept trusted host inputs; HTTP derives the user identity.

func New

func New(opts Options) (*Store, error)

New constructs the adapter over tables contentkit.New installs.

func (*Store) Handler

func (s *Store) Handler(a auth.Authenticator) (http.Handler, error)

Handler serves the authenticated person's inbox and read state, and the host service's publish route. People select no recipient and write no notices.

func (*Store) PublishBatch added in v0.83.0

func (s *Store) PublishBatch(ctx context.Context, in []notify.Input) ([]notify.Item, error)

PublishBatch stores a batch in one transaction (see the publish route).

Directories

Path Synopsis
Package openrails consumes independently acknowledged OpenRails notification events.
Package openrails consumes independently acknowledged OpenRails notification events.

Jump to

Keyboard shortcuts

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