memory

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLiteStore

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

SQLiteStore implements the Memory interface using SQLite as the backend.

func NewSQLiteStore

func NewSQLiteStore(path string) (*SQLiteStore, error)

NewSQLiteStore creates a new SQLite-backed memory store. The path parameter specifies the database file location. If path is ":memory:", the database will be created in-memory.

func (*SQLiteStore) CleanExpired

func (s *SQLiteStore) CleanExpired(ctx context.Context) (int64, error)

CleanExpired removes all expired entries from the store.

func (*SQLiteStore) Clear

func (s *SQLiteStore) Clear() error

Clear implements the Memory interface Clear method.

func (*SQLiteStore) Close

func (s *SQLiteStore) Close() error

Close closes the database connection.

func (*SQLiteStore) List

func (s *SQLiteStore) List() ([]string, error)

List implements the Memory interface List method.

func (*SQLiteStore) Retrieve

func (s *SQLiteStore) Retrieve(key string) (interface{}, error)

Retrieve implements the Memory interface Retrieve method.

func (*SQLiteStore) Store

func (s *SQLiteStore) Store(key string, value interface{}) error

Store implements the Memory interface Store method.

func (*SQLiteStore) StoreWithTTL

func (s *SQLiteStore) StoreWithTTL(ctx context.Context, key string, value interface{}, ttl time.Duration) error

StoreWithTTL stores a value with a time-to-live duration.

Jump to

Keyboard shortcuts

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