Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseConfig ¶
type BaseConfig struct {
DefaultTTL time.Duration
Prefix string
Compression CompressionCodec
MaxValueBytes int
EncryptionKey []byte
}
BaseConfig contains shared, backend-agnostic driver configuration.
type CompressionCodec ¶
type CompressionCodec string
CompressionCodec represents a value compression algorithm.
const ( CompressionNone CompressionCodec = "none" CompressionGzip CompressionCodec = "gzip" CompressionSnappy CompressionCodec = "snappy" )
type Store ¶
type Store interface {
Driver() Driver
Ready(ctx context.Context) error
Get(ctx context.Context, key string) ([]byte, bool, error)
Set(ctx context.Context, key string, value []byte, ttl time.Duration) error
Add(ctx context.Context, key string, value []byte, ttl time.Duration) (bool, error)
Increment(ctx context.Context, key string, delta int64, ttl time.Duration) (int64, error)
Decrement(ctx context.Context, key string, delta int64, ttl time.Duration) (int64, error)
Delete(ctx context.Context, key string) error
DeleteMany(ctx context.Context, keys ...string) error
Flush(ctx context.Context) error
}
Store is the shared app cache contract.
Click to show internal directories.
Click to hide internal directories.