Documentation
¶
Overview ¶
Package redis implements the storage.Backend interface for redis.
Index ¶
- Constants
- Variables
- type DB
- func (db *DB) ClearDeleted(ctx context.Context, cutoff time.Time)
- func (db *DB) Close() error
- func (db *DB) Delete(ctx context.Context, id string) (err error)
- func (db *DB) Get(ctx context.Context, id string) (record *databroker.Record, err error)
- func (db *DB) List(ctx context.Context, sinceVersion string) (records []*databroker.Record, err error)
- func (db *DB) Put(ctx context.Context, id string, data *anypb.Any) (err error)
- func (db *DB) Watch(ctx context.Context) <-chan struct{}
- type Option
Constants ¶
View Source
const Name = config.StorageRedisName
Name of the storage backend.
Variables ¶
View Source
var (
ErrExceededMaxRetries = errors.New("redis: transaction reached maximum number of retries")
)
custom errors
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB implements the storage.Backend on top of redis.
func (*DB) ClearDeleted ¶
ClearDeleted clears all the deleted records older than the cutoff time.
func (*DB) List ¶
func (db *DB) List(ctx context.Context, sinceVersion string) (records []*databroker.Record, err error)
List lists all the records changed since the sinceVersion. Records are sorted in version order.
type Option ¶
type Option func(*dbConfig)
Option customizes a DB.
func WithRecordType ¶ added in v0.12.0
WithRecordType sets the record type in the config.
func WithTLSConfig ¶
WithTLSConfig sets the tls.Config which DB uses.
Click to show internal directories.
Click to hide internal directories.