Documentation
¶
Index ¶
- Constants
- type Backend
- func (b *Backend[K, V]) Close(ctx context.Context) error
- func (b *Backend[K, V]) Delete(ctx context.Context, key K) error
- func (b *Backend[K, V]) Flush(ctx context.Context) error
- func (b *Backend[K, V]) Get(ctx context.Context, key K) (V, bool, error)
- func (b *Backend[K, V]) List(ctx context.Context, pageSize *int, pageToken *K) (iter.Seq2[K, V], *K, error)
- func (b *Backend[K, V]) Set(ctx context.Context, key K, value V) error
Constants ¶
View Source
const DefaultListPageSize = 25
DefaultListPageSize is the default page size for listing items.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend[K comparable, V any] struct { // contains filtered or unexported fields }
Backend is a storage backend that uses Pebble as the underlying storage engine.
Pebble can use an in-memory filesystem or a directory on disk for storage, depending on the options provided. By default, this application uses a directory on disk.
func NewBackend ¶
func NewBackend[K comparable, V any](dirname string, opts *pebble.Options, codec storage.Codec[K, V]) (*Backend[K, V], error)
NewBackend creates a new Pebble storage backend.
Click to show internal directories.
Click to hide internal directories.