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

notification

package
v1.9.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 notification defines the notification domain entity and its store interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel string

Channel identifies the delivery mechanism.

const (
	ChannelEmail Channel = "email"
	ChannelSMS   Channel = "sms"
	ChannelPush  Channel = "push"
)

type Notification

type Notification struct {
	ID        id.NotificationID `json:"id"`
	AppID     id.AppID          `json:"app_id"`
	EnvID     id.EnvironmentID  `json:"env_id"`
	UserID    id.UserID         `json:"user_id"`
	Type      string            `json:"type"`
	Channel   Channel           `json:"channel"`
	Subject   string            `json:"subject,omitempty"`
	Body      string            `json:"body"`
	Sent      bool              `json:"sent"`
	SentAt    *time.Time        `json:"sent_at,omitempty"`
	CreatedAt time.Time         `json:"created_at"`
}

Notification represents a notification sent to a user.

type Store

type Store interface {
	CreateNotification(ctx context.Context, n *Notification) error
	GetNotification(ctx context.Context, notifID id.NotificationID) (*Notification, error)
	MarkSent(ctx context.Context, notifID id.NotificationID) error
	ListUserNotifications(ctx context.Context, userID id.UserID) ([]*Notification, error)
}

Store defines the persistence interface for notification operations.

Jump to

Keyboard shortcuts

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