Documentation
¶
Index ¶
- func New(path string, opts Options) (blob.Store, error)
- type Builder
- type Options
- type Store
- func (s *Store) Close() error
- func (s *Store) Delete(rid resource.RID) error
- func (s *Store) DeleteVersion(rid resource.RID, version timestamp.Nano) error
- func (s *Store) DeleteVersions(rid resource.RID, lower timestamp.Nano, upper timestamp.Nano) error
- func (s *Store) GetCharacterCard(rid resource.RID, version timestamp.Nano) (*png.CharacterCard, error)
- func (s *Store) GetRawCard(rid resource.RID, version timestamp.Nano) (*png.RawCard, error)
- func (s *Store) GetRawCardBytes(rid resource.RID, version timestamp.Nano) ([]byte, error)
- func (s *Store) GetSheet(rid resource.RID, version timestamp.Nano) (*character.Sheet, error)
- func (s *Store) GetSheetBytes(rid resource.RID, version timestamp.Nano) ([]byte, error)
- func (s *Store) Put(rid resource.RID, version timestamp.Nano, characterCard *png.CharacterCard) error
- func (s *Store) RIDs() ([]resource.RID, error)
- func (s *Store) Thumbnail(rid resource.RID) (image.Image, error)
- func (s *Store) ThumbnailBytes(rid resource.RID) ([]byte, error)
- func (s *Store) VersionExists(rid resource.RID, version timestamp.Nano) (bool, error)
- func (s *Store) Versions(rid resource.RID) []timestamp.Nano
- func (s *Store) WithContext(ctx context.Context) blob.CtxStore
- func (s *Store) WithReadTx(fn func(store blob.TxReadStore) error) error
- func (s *Store) WithTx(fn func(store blob.TxStore) error) error
- func (s *Store) WithWriteTx(fn func(store blob.TxWriteStore) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements blob.Store using SQLite
func (*Store) DeleteVersion ¶
DeleteVersion deletes a specific version of a card
func (*Store) DeleteVersions ¶
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 ¶
GetRawCard returns a parsed RawCard from the PNG blob
func (*Store) GetRawCardBytes ¶
GetRawCardBytes returns the raw PNG bytes for a card
func (*Store) GetSheetBytes ¶
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) ThumbnailBytes ¶
ThumbnailBytes returns the raw WebP thumbnail bytes for a card
func (*Store) VersionExists ¶
VersionExists checks if a specific version exists for a card
func (*Store) WithContext ¶
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) WithWriteTx ¶
func (s *Store) WithWriteTx(fn func(store blob.TxWriteStore) error) error
WithWriteTx runs a function within a write transaction