Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMsgCorrupted = errors.New("ecrypted file was corrupted") ErrLowSpace = errors.New("not enough free space left on device") )
View Source
var ErrCacheNeedsUnlock = errors.New("cache needs to be unlocked")
Functions ¶
func IsOnDiskCache ¶
IsOnDiskCache will return true if Cache is type of onDiskCache.
Types ¶
type Cache ¶
type Cache interface { Unlock(userID string, passphrase []byte) error Lock(userID string) Delete(userID string) error Has(userID, messageID string) bool Get(userID, messageID string) ([]byte, error) Set(userID, messageID string, literal []byte) error Rem(userID, messageID string) error }
func NewInMemoryCache ¶
NewInMemoryCache creates a new in memory cache which stores up to the given number of bytes of cached data. NOTE(GODT-1158): Make this threadsafe.
func NewOnDiskCache ¶
func NewOnDiskCache(path string, cmp Compressor, opts Options) (Cache, error)
type Compressor ¶
type GZipCompressor ¶
type GZipCompressor struct{}
func (GZipCompressor) Decompress ¶
func (GZipCompressor) Decompress(cmp []byte) ([]byte, error)
type NoopCompressor ¶
type NoopCompressor struct{}
func (NoopCompressor) Decompress ¶
func (NoopCompressor) Decompress(cmp []byte) ([]byte, error)
Click to show internal directories.
Click to hide internal directories.