redisstore

package
v0.0.0-...-02ed867 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2023 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProfileClient

func ProfileClient(client *redis.Client, profiler Profiler) *redis.Client

Types

type AtomicWriteOperation

type AtomicWriteOperation struct {
	Client *redis.Client
	// contains filtered or unexported fields
}

func (*AtomicWriteOperation) Delete

func (*AtomicWriteOperation) DeleteXX

func (*AtomicWriteOperation) Exec

func (op *AtomicWriteOperation) Exec() (bool, error)

func (*AtomicWriteOperation) HDel

func (op *AtomicWriteOperation) HDel(key string, field string, fields ...string) keyvaluestore.AtomicWriteResult

func (*AtomicWriteOperation) HSet

func (op *AtomicWriteOperation) HSet(key, field string, value interface{}, fields ...keyvaluestore.KeyValue) keyvaluestore.AtomicWriteResult

func (*AtomicWriteOperation) HSetNX

func (op *AtomicWriteOperation) HSetNX(key, field string, value interface{}) keyvaluestore.AtomicWriteResult

func (*AtomicWriteOperation) NIncrBy

func (*AtomicWriteOperation) SAdd

func (op *AtomicWriteOperation) SAdd(key string, member interface{}, members ...interface{}) keyvaluestore.AtomicWriteResult

func (*AtomicWriteOperation) SRem

func (op *AtomicWriteOperation) SRem(key string, member interface{}, members ...interface{}) keyvaluestore.AtomicWriteResult

func (*AtomicWriteOperation) Set

func (op *AtomicWriteOperation) Set(key string, value interface{}) keyvaluestore.AtomicWriteResult

func (*AtomicWriteOperation) SetEQ

func (op *AtomicWriteOperation) SetEQ(key string, value, oldValue interface{}) keyvaluestore.AtomicWriteResult

func (*AtomicWriteOperation) SetNX

func (op *AtomicWriteOperation) SetNX(key string, value interface{}) keyvaluestore.AtomicWriteResult

func (*AtomicWriteOperation) SetXX

func (op *AtomicWriteOperation) SetXX(key string, value interface{}) keyvaluestore.AtomicWriteResult

func (*AtomicWriteOperation) ZAdd

func (op *AtomicWriteOperation) ZAdd(key string, member interface{}, score float64) keyvaluestore.AtomicWriteResult

func (*AtomicWriteOperation) ZAddNX

func (op *AtomicWriteOperation) ZAddNX(key string, member interface{}, score float64) keyvaluestore.AtomicWriteResult

func (*AtomicWriteOperation) ZHAdd

func (op *AtomicWriteOperation) ZHAdd(key, field string, member interface{}, score float64) keyvaluestore.AtomicWriteResult

func (*AtomicWriteOperation) ZHRem

func (*AtomicWriteOperation) ZRem

func (op *AtomicWriteOperation) ZRem(key string, member interface{}) keyvaluestore.AtomicWriteResult

type Backend

type Backend struct {
	Client *redis.Client
}

func (*Backend) AtomicWrite

func (b *Backend) AtomicWrite() keyvaluestore.AtomicWriteOperation

func (*Backend) Batch

func (*Backend) Delete

func (b *Backend) Delete(key string) (bool, error)

func (*Backend) Get

func (b *Backend) Get(key string) (*string, error)

func (*Backend) HDel

func (b *Backend) HDel(key string, field string, fields ...string) error

func (*Backend) HGet

func (b *Backend) HGet(key, field string) (*string, error)

func (*Backend) HGetAll

func (b *Backend) HGetAll(key string) (map[string]string, error)

func (*Backend) HSet

func (b *Backend) HSet(key, field string, value interface{}, fields ...keyvaluestore.KeyValue) error

func (*Backend) NIncrBy

func (b *Backend) NIncrBy(key string, n int64) (int64, error)

func (*Backend) SAdd

func (b *Backend) SAdd(key string, member interface{}, members ...interface{}) error

func (*Backend) SMembers

func (b *Backend) SMembers(key string) ([]string, error)

func (*Backend) SRem

func (b *Backend) SRem(key string, member interface{}, members ...interface{}) error

func (*Backend) Set

func (b *Backend) Set(key string, value interface{}) error

func (*Backend) SetEQ

func (b *Backend) SetEQ(key string, value, oldValue interface{}) (bool, error)

func (*Backend) SetNX

func (b *Backend) SetNX(key string, value interface{}) (bool, error)

func (*Backend) SetXX

func (b *Backend) SetXX(key string, value interface{}) (bool, error)

func (*Backend) Unwrap

func (b *Backend) Unwrap() keyvaluestore.Backend

func (*Backend) WithEventuallyConsistentReads

func (b *Backend) WithEventuallyConsistentReads() keyvaluestore.Backend

func (*Backend) WithProfiler

func (b *Backend) WithProfiler(profiler interface{}) keyvaluestore.Backend

func (*Backend) ZAdd

func (b *Backend) ZAdd(key string, member interface{}, score float64) error

func (*Backend) ZCount

func (b *Backend) ZCount(key string, min, max float64) (int, error)

func (*Backend) ZHAdd

func (b *Backend) ZHAdd(key, field string, member interface{}, score float64) error

func (*Backend) ZHGet

func (b *Backend) ZHGet(key, field string) (*string, error)

func (*Backend) ZHRangeByLex

func (b *Backend) ZHRangeByLex(key string, min, max string, limit int) ([]string, error)

func (*Backend) ZHRangeByScore

func (b *Backend) ZHRangeByScore(key string, min, max float64, limit int) ([]string, error)

func (*Backend) ZHRangeByScoreWithScores

func (b *Backend) ZHRangeByScoreWithScores(key string, min, max float64, limit int) (keyvaluestore.ScoredMembers, error)

func (*Backend) ZHRem

func (b *Backend) ZHRem(key, field string) error

func (*Backend) ZHRevRangeByLex

func (b *Backend) ZHRevRangeByLex(key string, min, max string, limit int) ([]string, error)

func (*Backend) ZHRevRangeByScore

func (b *Backend) ZHRevRangeByScore(key string, min, max float64, limit int) ([]string, error)

func (*Backend) ZHRevRangeByScoreWithScores

func (b *Backend) ZHRevRangeByScoreWithScores(key string, min, max float64, limit int) (keyvaluestore.ScoredMembers, error)

func (*Backend) ZIncrBy

func (b *Backend) ZIncrBy(key string, member interface{}, n float64) (float64, error)

func (*Backend) ZLexCount

func (b *Backend) ZLexCount(key string, min, max string) (int, error)

func (*Backend) ZRangeByLex

func (b *Backend) ZRangeByLex(key string, min, max string, limit int) ([]string, error)

func (*Backend) ZRangeByScore

func (b *Backend) ZRangeByScore(key string, min, max float64, limit int) ([]string, error)

func (*Backend) ZRangeByScoreWithScores

func (b *Backend) ZRangeByScoreWithScores(key string, min, max float64, limit int) (keyvaluestore.ScoredMembers, error)

func (*Backend) ZRem

func (b *Backend) ZRem(key string, member interface{}) error

func (*Backend) ZRevRangeByLex

func (b *Backend) ZRevRangeByLex(key string, min, max string, limit int) ([]string, error)

func (*Backend) ZRevRangeByScore

func (b *Backend) ZRevRangeByScore(key string, min, max float64, limit int) ([]string, error)

func (*Backend) ZRevRangeByScoreWithScores

func (b *Backend) ZRevRangeByScoreWithScores(key string, min, max float64, limit int) (keyvaluestore.ScoredMembers, error)

func (*Backend) ZScore

func (b *Backend) ZScore(key string, member interface{}) (*float64, error)

type BasicProfiler

type BasicProfiler struct {
	// contains filtered or unexported fields
}

func (*BasicProfiler) AddRedisCommandProfile

func (p *BasicProfiler) AddRedisCommandProfile(cmd redis.Cmder, duration time.Duration)

func (*BasicProfiler) AddRedisPipelineProfile

func (p *BasicProfiler) AddRedisPipelineProfile(cmds []redis.Cmder, duration time.Duration)

func (*BasicProfiler) RedisCommandCount

func (p *BasicProfiler) RedisCommandCount() int

func (*BasicProfiler) RedisCommandDuration

func (p *BasicProfiler) RedisCommandDuration() time.Duration

func (*BasicProfiler) RedisRoundTripCount

func (p *BasicProfiler) RedisRoundTripCount() int

type BatchOperation

type BatchOperation struct {
	// contains filtered or unexported fields
}

func (*BatchOperation) Delete

func (*BatchOperation) Exec

func (op *BatchOperation) Exec() error

func (*BatchOperation) Get

func (*BatchOperation) SAdd

func (op *BatchOperation) SAdd(key string, member interface{}, members ...interface{}) keyvaluestore.ErrorResult

func (*BatchOperation) SMembers

func (*BatchOperation) SRem

func (op *BatchOperation) SRem(key string, member interface{}, members ...interface{}) keyvaluestore.ErrorResult

func (*BatchOperation) Set

func (op *BatchOperation) Set(key string, value interface{}) keyvaluestore.ErrorResult

func (*BatchOperation) ZAdd

func (op *BatchOperation) ZAdd(key string, member interface{}, score float64) keyvaluestore.ErrorResult

func (*BatchOperation) ZHGet

func (op *BatchOperation) ZHGet(key, field string) keyvaluestore.GetResult

func (*BatchOperation) ZRem

func (op *BatchOperation) ZRem(key string, member interface{}) keyvaluestore.ErrorResult

func (*BatchOperation) ZScore

func (op *BatchOperation) ZScore(key string, member interface{}) keyvaluestore.ZScoreResult

type ErrorResult

type ErrorResult struct {
	RedisCmd
}

func (*ErrorResult) Result

func (r *ErrorResult) Result() error

type GetResult

type GetResult struct {
	*redis.StringCmd
}

func (*GetResult) Result

func (r *GetResult) Result() (*string, error)

type Profiler

type Profiler interface {
	AddRedisCommandProfile(cmd redis.Cmder, duration time.Duration)
	AddRedisPipelineProfile(cmds []redis.Cmder, duration time.Duration)
}

type RedisCmd

type RedisCmd interface {
	Err() error
}

type SMembersResult

type SMembersResult struct {
	*redis.StringSliceCmd
}

func (*SMembersResult) Result

func (r *SMembersResult) Result() ([]string, error)

type ZScoreResult

type ZScoreResult struct {
	*redis.FloatCmd
}

func (*ZScoreResult) Result

func (r *ZScoreResult) Result() (*float64, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL