memory

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package memory provides an in-memory Store implementation for testing.

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 implementation of herald's composite store.

func New

func New() *Store

New creates a new in-memory store.

func (*Store) Close

func (s *Store) Close() error

func (*Store) CountMessages

func (s *Store) CountMessages(_ context.Context, appID string, since time.Time) ([]message.Count, error)

func (*Store) CreateMessage

func (s *Store) CreateMessage(_ context.Context, m *message.Message) error

func (*Store) CreateNotification

func (s *Store) CreateNotification(_ context.Context, n *inbox.Notification) error

func (*Store) CreateProvider

func (s *Store) CreateProvider(_ context.Context, p *provider.Provider) error

func (*Store) CreateTemplate

func (s *Store) CreateTemplate(_ context.Context, t *template.Template) error

func (*Store) CreateVersion

func (s *Store) CreateVersion(_ context.Context, v *template.Version) error

func (*Store) DeleteDevice

func (s *Store) DeleteDevice(_ context.Context, appID, deviceID string) error

func (*Store) DeleteNotification

func (s *Store) DeleteNotification(_ context.Context, notifID id.InboxID) error

func (*Store) DeletePreference

func (s *Store) DeletePreference(_ context.Context, appID, userID string) error

func (*Store) DeleteProvider

func (s *Store) DeleteProvider(_ context.Context, providerID id.ProviderID) error

func (*Store) DeleteScopedConfig

func (s *Store) DeleteScopedConfig(_ context.Context, configID id.ScopedConfigID) error

func (*Store) DeleteTemplate

func (s *Store) DeleteTemplate(_ context.Context, templateID id.TemplateID) error

func (*Store) DeleteUserDevices

func (s *Store) DeleteUserDevices(_ context.Context, appID, userID string) error

func (*Store) DeleteVersion

func (s *Store) DeleteVersion(_ context.Context, versionID id.TemplateVersionID) error

func (*Store) GetDevice

func (s *Store) GetDevice(_ context.Context, appID, deviceID string) (*device.Device, error)

func (*Store) GetMessage

func (s *Store) GetMessage(_ context.Context, messageID id.MessageID) (*message.Message, error)

func (*Store) GetNotification

func (s *Store) GetNotification(_ context.Context, notifID id.InboxID) (*inbox.Notification, error)

func (*Store) GetPreference

func (s *Store) GetPreference(_ context.Context, appID, userID string) (*preference.Preference, error)

func (*Store) GetProvider

func (s *Store) GetProvider(_ context.Context, providerID id.ProviderID) (*provider.Provider, error)

func (*Store) GetScopedConfig

func (s *Store) GetScopedConfig(_ context.Context, appID string, scopeType scope.ScopeType, scopeID string) (*scope.Config, error)

func (*Store) GetTemplate

func (s *Store) GetTemplate(_ context.Context, templateID id.TemplateID) (*template.Template, error)

func (*Store) GetTemplateBySlug

func (s *Store) GetTemplateBySlug(_ context.Context, appID, slug, channel string) (*template.Template, error)

func (*Store) GetVersion

func (s *Store) GetVersion(_ context.Context, versionID id.TemplateVersionID) (*template.Version, error)

func (*Store) ListAllProviders

func (s *Store) ListAllProviders(_ context.Context, appID string) ([]*provider.Provider, error)

func (*Store) ListDevices

func (s *Store) ListDevices(_ context.Context, appID, userID string) ([]*device.Device, error)

func (*Store) ListMessages

func (s *Store) ListMessages(_ context.Context, appID string, opts message.ListOptions) ([]*message.Message, error)

func (*Store) ListNotifications

func (s *Store) ListNotifications(_ context.Context, appID, userID string, limit, offset int) ([]*inbox.Notification, error)

func (*Store) ListProviders

func (s *Store) ListProviders(_ context.Context, appID string, channel string) ([]*provider.Provider, error)

func (*Store) ListScopedConfigs

func (s *Store) ListScopedConfigs(_ context.Context, appID string) ([]*scope.Config, error)

func (*Store) ListTemplates

func (s *Store) ListTemplates(_ context.Context, appID string) ([]*template.Template, error)

func (*Store) ListTemplatesByChannel

func (s *Store) ListTemplatesByChannel(_ context.Context, appID, channel string) ([]*template.Template, error)

func (*Store) ListVersions

func (s *Store) ListVersions(_ context.Context, templateID id.TemplateID) ([]*template.Version, error)

func (*Store) MarkAllRead

func (s *Store) MarkAllRead(_ context.Context, appID, userID string) error

func (*Store) MarkRead

func (s *Store) MarkRead(_ context.Context, notifID id.InboxID) error

func (*Store) Migrate

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

func (*Store) Ping

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

func (*Store) RecordDelivery

func (s *Store) RecordDelivery(_ context.Context, messageID id.MessageID, d message.Delivery) error

func (*Store) SaveDevice

func (s *Store) SaveDevice(_ context.Context, d *device.Device) error

func (*Store) SetPreference

func (s *Store) SetPreference(_ context.Context, p *preference.Preference) error

func (*Store) SetScopedConfig

func (s *Store) SetScopedConfig(_ context.Context, cfg *scope.Config) error

func (*Store) UnreadCount

func (s *Store) UnreadCount(_ context.Context, appID, userID string) (int, error)

func (*Store) UpdateProvider

func (s *Store) UpdateProvider(_ context.Context, p *provider.Provider) error

func (*Store) UpdateTemplate

func (s *Store) UpdateTemplate(_ context.Context, t *template.Template) error

func (*Store) UpdateVersion

func (s *Store) UpdateVersion(_ context.Context, v *template.Version) error

Jump to

Keyboard shortcuts

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