Documentation ¶
Overview ¶
package store implements types that store message literals.
Messages may be stored either in-memory or on-disk. When stored on disk, they are stored encrypted and optionally compressed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadgerStore ¶ added in v0.9.0
type BadgerStore struct {
// contains filtered or unexported fields
}
func NewBadgerStore ¶ added in v0.9.0
func NewBadgerStore(path string, userID string, encryptionPassphrase []byte) (*BadgerStore, error)
func (*BadgerStore) Close ¶ added in v0.9.0
func (b *BadgerStore) Close() error
func (*BadgerStore) Delete ¶ added in v0.9.0
func (b *BadgerStore) Delete(messageID ...string) error
func (*BadgerStore) Get ¶ added in v0.9.0
func (b *BadgerStore) Get(messageID string) ([]byte, error)
func (*BadgerStore) Set ¶ added in v0.9.0
func (b *BadgerStore) Set(messageID string, literal []byte) error
func (*BadgerStore) Update ¶ added in v0.9.0
func (b *BadgerStore) Update(oldID, newID string) error
type BadgerStoreBuilder ¶ added in v0.9.0
type BadgerStoreBuilder struct{}
type Compressor ¶
type GZipCompressor ¶
type GZipCompressor struct{}
func (GZipCompressor) Decompress ¶
func (GZipCompressor) Decompress(cmp []byte) ([]byte, error)
type OnDiskStoreBuilder ¶ added in v0.9.0
type OnDiskStoreBuilder struct{}
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithCompressor ¶
func WithCompressor(cmp Compressor) Option
func WithSemaphore ¶
type Semaphore ¶
type Semaphore struct {
// contains filtered or unexported fields
}
Semaphore implements a type used to limit concurrent operations.
func NewSemaphore ¶
NewSemaphore constructs a new semaphore with the given limit.
func (*Semaphore) Block ¶
func (sem *Semaphore) Block()
Block prevents the semaphore from being locked.
func (*Semaphore) Do ¶
func (sem *Semaphore) Do(fn func())
Do executes the given function synchronously.
func (*Semaphore) Go ¶
func (sem *Semaphore) Go(fn func())
Go executes the given function asynchronously.
func (*Semaphore) Lock ¶
func (sem *Semaphore) Lock()
Lock locks the semaphore, waiting first until it is possible.
type Store ¶
type Store interface { Get(messageID string) ([]byte, error) Set(messageID string, literal []byte) error Update(oldID, newID string) error Delete(messageID ...string) error Close() error }
func NewInMemoryStore ¶
func NewInMemoryStore() Store
type StoreBuilder ¶ added in v0.9.0
type ZLibCompressor ¶
type ZLibCompressor struct{}
func (ZLibCompressor) Decompress ¶
func (ZLibCompressor) Decompress(cmp []byte) ([]byte, error)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_store is a generated GoMock package.
|
Package mock_store is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.