alfdb

package
v0.0.0-...-eb726d4 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Overview

Package alfdb provides tools to store a Bluesky/Mastodon db-index of records (Bluesky) and statuses (Mastodon).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SchemaVersion

func SchemaVersion() int

Types

type DB

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

DB stores alfari data as a SQLite-backed database.

func Create

func Create(root string) (*DB, error)

Create creates a new sqlite db under root.

func Open

func Open(root string) (*DB, error)

Open opens the named sqlite db.

func (*DB) Account

func (db *DB) Account(ctx context.Context, acc alfari.Account) (alfari.Account, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) Creds

func (db *DB) Creds(ctx context.Context, acc alfari.Account) (alfari.Account, error)

func (*DB) DelMedia

func (db *DB) DelMedia(ctx context.Context, acc alfari.Account, bscid string) error

func (*DB) Do

func (db *DB) Do(ctx context.Context, f func(tx *sql.Tx) error) (err error)

func (*DB) GetMedia

func (db *DB) GetMedia(ctx context.Context, acc alfari.Account, bscid string) (media alfari.Media, err error)

func (*DB) Name

func (db *DB) Name() string

func (*DB) PutMedia

func (db *DB) PutMedia(ctx context.Context, acc alfari.Account, media alfari.Media) error

func (*DB) PutToot

func (db *DB) PutToot(ctx context.Context, toot alfari.Toot) error

func (*DB) Sync

func (db *DB) Sync(ctx context.Context) error

Sync synchronizes the DB content on disk and compacts it.

func (*DB) Thread

func (db *DB) Thread(ctx context.Context, acc alfari.Account, bsid string) (alfari.Thread, error)

func (*DB) Threads

func (db *DB) Threads(ctx context.Context, acc alfari.Account) iter.Seq2[alfari.Thread, error]

func (*DB) Toot

func (db *DB) Toot(ctx context.Context, acc alfari.Account, bsid string) (toot alfari.Toot, err error)

func (*DB) Toots

func (db *DB) Toots(ctx context.Context, acc alfari.Account) iter.Seq2[alfari.Toot, error]

Jump to

Keyboard shortcuts

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