sqlblob

package
v1.0.77 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(path string, opts Options) (blob.Store, error)

New creates a new SQLite blob store at the given path

Types

type Builder

type Builder Options

Builder implements blob.Builder using SQLite

func (Builder) Build

func (b Builder) Build(path string) (blob.Store, error)

type Options

type Options struct {
	MaxVersions   int
	ThumbnailSize int
}

Options configures the SQLite blob store

type Store

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

Store implements blob.Store using SQLite

func (*Store) Close

func (s *Store) Close() error

Close closes the underlying database connection

func (*Store) Delete

func (s *Store) Delete(rid resource.RID) error

Delete removes all data for a card (all versions + thumbnail)

func (*Store) DeleteVersion

func (s *Store) DeleteVersion(rid resource.RID, version timestamp.Nano) error

DeleteVersion deletes a specific version of a card

func (*Store) DeleteVersions

func (s *Store) DeleteVersions(rid resource.RID, lower timestamp.Nano, upper timestamp.Nano) error

DeleteVersions deletes a range of versions for a card [lower, upper)

func (*Store) GetCharacterCard

func (s *Store) GetCharacterCard(rid resource.RID, version timestamp.Nano) (*png.CharacterCard, error)

GetCharacterCard returns a decoded CharacterCard from the PNG blob

func (*Store) GetRawCard

func (s *Store) GetRawCard(rid resource.RID, version timestamp.Nano) (*png.RawCard, error)

GetRawCard returns a parsed RawCard from the PNG blob

func (*Store) GetRawCardBytes

func (s *Store) GetRawCardBytes(rid resource.RID, version timestamp.Nano) ([]byte, error)

GetRawCardBytes returns the raw PNG bytes for a card

func (*Store) GetSheet

func (s *Store) GetSheet(rid resource.RID, version timestamp.Nano) (*character.Sheet, error)

GetSheet returns the character Sheet extracted from the PNG blob

func (*Store) GetSheetBytes

func (s *Store) GetSheetBytes(rid resource.RID, version timestamp.Nano) ([]byte, error)

GetSheetBytes returns the raw JSON bytes extracted from the PNG blob

func (*Store) Put

func (s *Store) Put(rid resource.RID, version timestamp.Nano, characterCard *png.CharacterCard) error

Put stores a CharacterCard as PNG blob + thumbnail, pruning old versions

func (*Store) RIDs

func (s *Store) RIDs() ([]resource.RID, error)

RIDs returns all unique RIDs in the store

func (*Store) Thumbnail

func (s *Store) Thumbnail(rid resource.RID) (image.Image, error)

Thumbnail returns the decoded thumbnail image for a card

func (*Store) ThumbnailBytes

func (s *Store) ThumbnailBytes(rid resource.RID) ([]byte, error)

ThumbnailBytes returns the raw WebP thumbnail bytes for a card

func (*Store) VersionExists

func (s *Store) VersionExists(rid resource.RID, version timestamp.Nano) (bool, error)

VersionExists checks if a specific version exists for a card

func (*Store) Versions

func (s *Store) Versions(rid resource.RID) []timestamp.Nano

Versions returns all version timestamps for a card, sorted ascending

func (*Store) WithContext

func (s *Store) WithContext(ctx context.Context) blob.CtxStore

WithContext returns a context-aware copy of the store

func (*Store) WithReadTx

func (s *Store) WithReadTx(fn func(store blob.TxReadStore) error) error

WithReadTx runs a function within a read-only context

func (*Store) WithTx

func (s *Store) WithTx(fn func(store blob.TxStore) error) error

WithTx runs a function within a read-write transaction

func (*Store) WithWriteTx

func (s *Store) WithWriteTx(fn func(store blob.TxWriteStore) error) error

WithWriteTx runs a function within a write transaction

Jump to

Keyboard shortcuts

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