sqlite

package
v0.0.0-...-480f137 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package sqlite implements a SQLite storage backend for the message queue.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageStorage

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

MessageStorage is the SQLite storage backend for the message queue.

func NewMessageStorage

func NewMessageStorage(ctx context.Context, cfg *StorageConfig, logger *slog.Logger) (*MessageStorage, error)

NewMessageStorage creates a new SQLite storage backend for the message queue.

func (*MessageStorage) Close

func (s *MessageStorage) Close() error

func (*MessageStorage) RetrieveMessages

func (s *MessageStorage) RetrieveMessages(ctx context.Context, since time.Time, numbers []string) xiter.Seq2[*twismsproto.Message, error]

func (*MessageStorage) StoreMessage

func (s *MessageStorage) StoreMessage(ctx context.Context, msg *twismsproto.Message) error

type StorageConfig

type StorageConfig struct {
	// Path is the path to/URI for the SQLite database file.
	Path string `json:"path"`
	// MaxAge is the maximum age of messages to keep in the database.
	MaxAge cfgutil.Duration `json:"max_age"`
}

StorageConfig is the configuration for the "sqlite" storage backend.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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