Documentation ¶
Overview ¶
Package redis provides implementation of Go API for redis interface
Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- type Cmder
- type Conn
- type Connector
- type Deleter
- type Getter
- type Hook
- type IntCmd
- type Limiter
- type Lister
- type MockRedis
- func (m *MockRedis) Close() error
- func (m *MockRedis) Del(_ context.Context, keys ...string) *redis.IntCmd
- func (m *MockRedis) Get(_ context.Context, key string) *redis.StringCmd
- func (m *MockRedis) MGet(_ context.Context, keys ...string) *redis.SliceCmd
- func (m *MockRedis) Ping(context.Context) *StatusCmd
- func (m *MockRedis) TxPipeline() redis.Pipeliner
- type Option
- func WithAddrs(addrs ...string) Option
- func WithClusterSlots(f func(context.Context) ([]redis.ClusterSlot, error)) Option
- func WithDB(db int) Option
- func WithDialTimeout(dur string) Option
- func WithDialer(der net.Dialer) Option
- func WithDialerFunc(der func(ctx context.Context, addr, port string) (net.Conn, error)) Option
- func WithHooks(hooks ...Hook) Option
- func WithIdleCheckFrequency(dur string) Option
- func WithIdleTimeout(dur string) Option
- func WithInitialPingDuration(dur string) Option
- func WithInitialPingTimeLimit(lim string) Option
- func WithKeyPrefix(prefix string) Option
- func WithLimiter(limiter Limiter) Option
- func WithMaximumConnectionAge(dur string) Option
- func WithMaximumRetryBackoff(dur string) Option
- func WithMinimumIdleConnection(minIdleConns int) Option
- func WithMinimumRetryBackoff(dur string) Option
- func WithNetwork(network string) Option
- func WithOnConnectFunction(f func(context.Context, *redis.Conn) error) Option
- func WithPassword(password string) Option
- func WithPoolSize(poolSize int) Option
- func WithPoolTimeout(dur string) Option
- func WithReadOnlyFlag(readOnly bool) Option
- func WithReadTimeout(dur string) Option
- func WithRedirectLimit(maxRedirects int) Option
- func WithRetryLimit(maxRetries int) Option
- func WithRouteByLatencyFlag(routeByLatency bool) Option
- func WithRouteRandomlyFlag(routeRandomly bool) Option
- func WithSentinelMasterName(name string) Option
- func WithSentinelPassword(password string) Option
- func WithTLSConfig(cfg *tls.Config) Option
- func WithUsername(name string) Option
- func WithWriteTimeout(dur string) Option
- type Redis
- type Setter
- type StatusCmd
- type StringCmd
Constants ¶
This section is empty.
Variables ¶
var Nil = redis.Nil
Nil is a type alias of redis.Nil.
Functions ¶
This section is empty.
Types ¶
type MockRedis ¶ added in v1.0.5
type MockRedis struct { TxPipelineFunc func() redis.Pipeliner PingFunc func() *StatusCmd CloseFunc func() error GetFunc func(string) *redis.StringCmd MGetFunc func(...string) *redis.SliceCmd DelFunc func(keys ...string) *redis.IntCmd }
func (*MockRedis) TxPipeline ¶ added in v1.0.5
type Option ¶
type Option func(*redisClient) error
Option represents the functional option for redisClient.
func WithClusterSlots ¶
WithClusterSlots returns the option to set the clusterSlots.
func WithDialTimeout ¶
WithDialTimeout returns the option to set the dialTimeout.
func WithDialer ¶
WithDialer returns the option to set the dialer.
func WithDialerFunc ¶ added in v0.0.51
WithDialerFunc returns the option to set the dialer func.
func WithIdleCheckFrequency ¶
WithIdleCheckFrequency returns the option to set the idleCheckFrequency.
func WithIdleTimeout ¶
WithIdleTimeout returns the option to set the idleTimeout.
func WithInitialPingDuration ¶
WithInitialPingDuration returns the option to set the initialPingDuration.
func WithInitialPingTimeLimit ¶
WithInitialPingTimeLimit returns the option to set the initialPingTimeLimit.
func WithKeyPrefix ¶
WithKeyPrefix returns the option to set the keyPref.
func WithLimiter ¶ added in v1.0.0
WithLimiter returns the option to limiter.
func WithMaximumConnectionAge ¶
WithMaximumConnectionAge returns the option to set the maxConnAge.
func WithMaximumRetryBackoff ¶
WithMaximumRetryBackoff returns the option to set the maxRetryBackoff.
func WithMinimumIdleConnection ¶
WithMinimumIdleConnection returns the option to set the minIdleConns.
func WithMinimumRetryBackoff ¶
WithMinimumRetryBackoff returns the option to set the minRetryBackoff.
func WithNetwork ¶ added in v1.0.0
WithNetwork returns the option to set the network like tcp or unix.
func WithOnConnectFunction ¶
WithOnConnectFunction returns the option to set the onConnect.
func WithPassword ¶
WithPassword returns the option to set the password.
func WithPoolSize ¶
WithPoolSize returns the option to set the poolSize.
func WithPoolTimeout ¶
WithPoolTimeout returns the option to set the poolTimeout.
func WithReadOnlyFlag ¶
WithReadOnlyFlag returns the option to set the readOnly.
func WithReadTimeout ¶
WithReadTimeout returns the option to set the readTimeout.
func WithRedirectLimit ¶
WithRedirectLimit returns the option to set the maxRedirects.
func WithRetryLimit ¶
WithRetryLimit returns the option to set the maxRetries.
func WithRouteByLatencyFlag ¶
WithRouteByLatencyFlag returns the option to set the routeByLatency.
func WithRouteRandomlyFlag ¶
WithRouteRandomlyFlag returns the option to set the routeRandomly.
func WithSentinelMasterName ¶ added in v1.0.0
WithSentinelMasterName returns the option to set the password.
func WithSentinelPassword ¶ added in v1.0.0
WithSentinelPassword returns the option to set the password.
func WithTLSConfig ¶
WithTLSConfig returns the option to set the tlsConfig.
func WithUsername ¶ added in v1.0.0
WithUsername returns the option to set the username.
func WithWriteTimeout ¶
WithWriteTimeout returns the option to set the writeTimeout.