memory

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package memory provides an in-memory notify.Store for testing. It is not safe for use across multiple processes; for production multi-instance deployments use notify/redis instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is an in-memory notification store for single-instance and testing.

func New

func New() *Store

New creates a new in-memory notification store.

func (*Store) Cleanup

func (s *Store) Cleanup(_ context.Context, olderThan time.Time) error

Cleanup removes notifications older than the given time.

func (*Store) Close

func (s *Store) Close(_ context.Context) error

Close marks the store as closed.

func (*Store) List

func (s *Store) List(_ context.Context, userID string, afterID string, limit int) ([]notify.Event, error)

List returns notifications for a user after the given event ID.

func (*Store) Save

func (s *Store) Save(_ context.Context, evt *notify.Event) error

Save persists a notification event in memory.

Jump to

Keyboard shortcuts

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