blob

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	Build(path string) (Store, error)
}

Builder creates blob stores from a path

type CtxStore

type CtxStore interface {
	TxStore

	WithReadTx(fn func(TxReadStore) error) error
	WithWriteTx(fn func(TxWriteStore) error) error
	WithTx(fn func(TxStore) error) error
}

CtxStore is a context-aware blob store

type Store

type Store interface {
	CtxStore

	WithContext(ctx context.Context) CtxStore
	Close() error
}

Store is the main blob storage interface

type TxReadStore

type TxReadStore interface {
	RIDs() ([]resource.RID, error)
	GetCharacterCard(rid resource.RID, version timestamp.Nano) (*png.CharacterCard, error)
	GetRawCard(rid resource.RID, version timestamp.Nano) (*png.RawCard, error)
	GetRawCardBytes(rid resource.RID, version timestamp.Nano) ([]byte, error)
	GetSheet(rid resource.RID, version timestamp.Nano) (*character.Sheet, error)
	GetSheetBytes(rid resource.RID, version timestamp.Nano) ([]byte, error)
	Thumbnail(rid resource.RID) (image.Image, error)
	ThumbnailBytes(rid resource.RID) ([]byte, error)
	Versions(rid resource.RID) []timestamp.Nano
	VersionExists(rid resource.RID, version timestamp.Nano) (bool, error)
}

TxReadStore provides read operations for blobs

type TxStore

type TxStore interface {
	TxReadStore
	TxWriteStore

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

TxStore combines read and write operations with Put

type TxWriteStore

type TxWriteStore interface {
	DeleteVersion(rid resource.RID, version timestamp.Nano) error
	DeleteVersions(rid resource.RID, lower timestamp.Nano, upper timestamp.Nano) error
	Delete(rid resource.RID) error
}

TxWriteStore provides write/delete operations for blobs

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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