inbox

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package inbox defines the in-app notification entity for the inbox channel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notification

type Notification struct {
	ID        id.InboxID        `json:"id"`
	AppID     string            `json:"app_id"`
	EnvID     string            `json:"env_id,omitempty"`
	UserID    string            `json:"user_id"`
	Type      string            `json:"type"`
	Title     string            `json:"title"`
	Body      string            `json:"body,omitempty"`
	ActionURL string            `json:"action_url,omitempty"`
	ImageURL  string            `json:"image_url,omitempty"`
	Read      bool              `json:"read"`
	ReadAt    *time.Time        `json:"read_at,omitempty"`
	Metadata  map[string]string `json:"metadata,omitempty"`
	ExpiresAt *time.Time        `json:"expires_at,omitempty"`
	CreatedAt time.Time         `json:"created_at"`
}

Notification represents an in-app notification stored in a user's inbox.

type Store

type Store interface {
	CreateNotification(ctx context.Context, n *Notification) error
	GetNotification(ctx context.Context, notifID id.InboxID) (*Notification, error)
	DeleteNotification(ctx context.Context, notifID id.InboxID) error
	MarkRead(ctx context.Context, notifID id.InboxID) error
	MarkAllRead(ctx context.Context, appID string, userID string) error
	UnreadCount(ctx context.Context, appID string, userID string) (int, error)
	ListNotifications(ctx context.Context, appID string, userID string, limit, offset int) ([]*Notification, error)
}

Store defines persistence operations for in-app notifications.

Jump to

Keyboard shortcuts

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