redis

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFixedRateLimitCacheImpl added in v1.4.0

func NewFixedRateLimitCacheImpl(client Client, perSecondClient Client, timeSource utils.TimeSource,
	jitterRand *rand.Rand, expirationJitterMaxSeconds int64, localCache *freecache.Cache, nearLimitRatio float32, cacheKeyPrefix string, statsManager stats.Manager) limiter.RateLimitCache

func NewRateLimiterCacheImplFromSettings added in v1.4.0

func NewRateLimiterCacheImplFromSettings(s settings.Settings, localCache *freecache.Cache, srv server.Server, timeSource utils.TimeSource, jitterRand *rand.Rand, expirationJitterMaxSeconds int64, statsManager stats.Manager) limiter.RateLimitCache

Types

type Client added in v1.4.0

type Client interface {
	// DoCmd is used to perform a redis command and retrieve a result.
	//
	// @param rcv supplies receiver for the result.
	// @param cmd supplies the command to append.
	// @param key supplies the key to append.
	// @param args supplies the additional arguments.
	DoCmd(rcv interface{}, cmd, key string, args ...interface{}) error

	// PipeAppend append a command onto the pipeline queue.
	//
	// @param pipeline supplies the queue for pending commands.
	// @param rcv supplies receiver for the result.
	// @param cmd supplies the command to append.
	// @param key supplies the key to append.
	// @param args supplies the additional arguments.
	PipeAppend(pipeline Pipeline, rcv interface{}, cmd, key string, args ...interface{}) Pipeline

	// PipeDo writes multiple commands to a Conn in
	// a single write, then reads their responses in a single read. This reduces
	// network delay into a single round-trip.
	//
	// @param pipeline supplies the queue for pending commands.
	PipeDo(pipeline Pipeline) error

	// Once Close() is called all future method calls on the Client will return
	// an error
	Close() error

	// NumActiveConns return number of active connections, used in testing.
	NumActiveConns() int

	// ImplicitPipeliningEnabled return true if implicit pipelining is enabled.
	ImplicitPipeliningEnabled() bool
}

Interface for a redis client.

func NewClientImpl added in v1.4.0

func NewClientImpl(scope stats.Scope, useTls bool, auth, redisSocketType, redisType, url string, poolSize int,
	pipelineWindow time.Duration, pipelineLimit int, tlsConfig *tls.Config, healthCheckActiveConnection bool, srv server.Server) Client

type Pipeline added in v1.4.0

type Pipeline []radix.CmdAction

type RedisError

type RedisError string

Errors that may be raised during config parsing.

func (RedisError) Error

func (e RedisError) Error() string

Jump to

Keyboard shortcuts

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