redis

package
v0.0.0-...-37fef2a Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultRedisNetwork the redis network option, "tcp"
	DefaultRedisNetwork = "tcp"
	// DefaultRedisAddr the redis address option, "127.0.0.1:6379"
	DefaultRedisAddr = "127.0.0.1:6379"
	// DefaultRedisIdleTimeout the redis idle timeout option, time.Second
	DefaultRedisIdleTimeout = 60
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterCacheImpl

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

func (*ClusterCacheImpl) Del

func (impl *ClusterCacheImpl) Del(key string) error

func (*ClusterCacheImpl) Dels

func (impl *ClusterCacheImpl) Dels(args []string) error

func (*ClusterCacheImpl) Exists

func (impl *ClusterCacheImpl) Exists(key string) (bool, error)

func (*ClusterCacheImpl) Get

func (impl *ClusterCacheImpl) Get(key string) ([]byte, error)

func (*ClusterCacheImpl) HDel

func (impl *ClusterCacheImpl) HDel(key string, fields ...[]byte) (int64, error)

func (*ClusterCacheImpl) HExists

func (impl *ClusterCacheImpl) HExists(key string, field []byte) (bool, error)

func (*ClusterCacheImpl) HGetAll

func (impl *ClusterCacheImpl) HGetAll(key string) ([][]byte, error)

func (*ClusterCacheImpl) HMGet

func (impl *ClusterCacheImpl) HMGet(key string, fields ...[]byte) ([][]byte, error)

func (*ClusterCacheImpl) HMSet

func (impl *ClusterCacheImpl) HMSet(key string, ttl int64, args ...[]byte) error

func (*ClusterCacheImpl) HVals

func (impl *ClusterCacheImpl) HVals(key string) ([][]byte, error)

func (*ClusterCacheImpl) Initialize

func (impl *ClusterCacheImpl) Initialize(cfg interface{})

func (*ClusterCacheImpl) Keys

func (impl *ClusterCacheImpl) Keys(keyFormat string) ([][]byte, error)

func (*ClusterCacheImpl) SAdd

func (impl *ClusterCacheImpl) SAdd(key string, ttl int64, members ...[]byte) error

func (*ClusterCacheImpl) SCard

func (impl *ClusterCacheImpl) SCard(key string) (int64, error)

func (*ClusterCacheImpl) SIsMember

func (impl *ClusterCacheImpl) SIsMember(key string, member []byte) (bool, error)

func (*ClusterCacheImpl) SMembers

func (impl *ClusterCacheImpl) SMembers(key string) ([][]byte, error)

func (*ClusterCacheImpl) SRem

func (impl *ClusterCacheImpl) SRem(key string, members ...[]byte) (int64, error)

func (*ClusterCacheImpl) Set

func (impl *ClusterCacheImpl) Set(key string, value []byte, ttl int64) error

func (*ClusterCacheImpl) ZAdd

func (impl *ClusterCacheImpl) ZAdd(key string, ttl int64, args ...[]byte) error

func (*ClusterCacheImpl) ZRange

func (impl *ClusterCacheImpl) ZRange(key string, start, stop int64, withScores bool) ([][]byte, error)

func (*ClusterCacheImpl) ZRemRangeByScore

func (impl *ClusterCacheImpl) ZRemRangeByScore(key string, start, stop int64) (int64, error)

type ClusterOptions

type ClusterOptions struct {
	StartNodes   []string
	ConnTimeout  int
	ReadTimeout  int
	WriteTimeout int
	KeepAlive    int
	AliveTime    int
}

type RedisCacheImpl

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

func (*RedisCacheImpl) Close

func (impl *RedisCacheImpl) Close()

func (*RedisCacheImpl) Database

func (impl *RedisCacheImpl) Database() int

func (*RedisCacheImpl) Del

func (impl *RedisCacheImpl) Del(key string) error

func (*RedisCacheImpl) Dels

func (impl *RedisCacheImpl) Dels(args []string) error

func (*RedisCacheImpl) Exists

func (impl *RedisCacheImpl) Exists(key string) (bool, error)

func (*RedisCacheImpl) ExpireAt

func (impl *RedisCacheImpl) ExpireAt(key string, expireAt int64) error

func (*RedisCacheImpl) Get

func (impl *RedisCacheImpl) Get(key string) ([]byte, error)

func (*RedisCacheImpl) HDel

func (impl *RedisCacheImpl) HDel(key string, fields ...[]byte) (int64, error)

func (*RedisCacheImpl) HExists

func (impl *RedisCacheImpl) HExists(key string, field []byte) (bool, error)

func (*RedisCacheImpl) HGetAll

func (impl *RedisCacheImpl) HGetAll(key string) ([][]byte, error)

func (*RedisCacheImpl) HMGet

func (impl *RedisCacheImpl) HMGet(key string, fields ...[]byte) ([][]byte, error)

func (*RedisCacheImpl) HMSet

func (impl *RedisCacheImpl) HMSet(key string, ttl int64, args ...[]byte) error

func (*RedisCacheImpl) HVals

func (impl *RedisCacheImpl) HVals(key string) ([][]byte, error)

func (*RedisCacheImpl) Incr

func (impl *RedisCacheImpl) Incr(key string) (int64, error)

func (*RedisCacheImpl) Initialize

func (impl *RedisCacheImpl) Initialize(cfg interface{})

func (*RedisCacheImpl) Keys

func (impl *RedisCacheImpl) Keys(keyFormat string) ([][]byte, error)

func (*RedisCacheImpl) LPush

func (impl *RedisCacheImpl) LPush(key string, ttl int64, members ...[]byte) error

func (*RedisCacheImpl) Publish

func (impl *RedisCacheImpl) Publish(channel string, members ...[]byte) (int64, error)

func (*RedisCacheImpl) SAdd

func (impl *RedisCacheImpl) SAdd(key string, ttl int64, members ...[]byte) error

func (*RedisCacheImpl) SCard

func (impl *RedisCacheImpl) SCard(key string) (int64, error)

func (*RedisCacheImpl) SIsMember

func (impl *RedisCacheImpl) SIsMember(key string, member []byte) (bool, error)

func (*RedisCacheImpl) SMembers

func (impl *RedisCacheImpl) SMembers(key string) ([][]byte, error)

func (*RedisCacheImpl) SRem

func (impl *RedisCacheImpl) SRem(key string, members ...[]byte) (int64, error)

func (*RedisCacheImpl) SScan

func (impl *RedisCacheImpl) SScan(key string, count int64) ([][]byte, error)

func (*RedisCacheImpl) Set

func (impl *RedisCacheImpl) Set(key string, value []byte, ttl int64) error

func (*RedisCacheImpl) ZAdd

func (impl *RedisCacheImpl) ZAdd(key string, ttl int64, args ...[]byte) error

func (*RedisCacheImpl) ZRange

func (impl *RedisCacheImpl) ZRange(key string, start, stop int64, withScores bool) ([][]byte, error)

func (*RedisCacheImpl) ZRem

func (impl *RedisCacheImpl) ZRem(key string, members ...[]byte) (int64, error)

func (*RedisCacheImpl) ZRemRangeByScore

func (impl *RedisCacheImpl) ZRemRangeByScore(key string, start, stop int64) (int64, error)

type RedisOptions

type RedisOptions struct {
	Network     string
	Addr        string
	Password    string
	Prefix      string
	Database    int
	IdleTimeout int
	MaxIdle     int
	MaxActive   int
}

func DefaultOptions

func DefaultOptions() RedisOptions

DefaultConfig returns the default configuration for Redis service.

Jump to

Keyboard shortcuts

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