redis

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Id string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(db string) *Client

func (Client) Close

func (c Client) Close() error

自己创建的客户端一定要自己使用关闭

func (Client) Get

func (c Client) Get(key string) (string, error)

func (Client) GetDatabases

func (c Client) GetDatabases() (map[uint64]string, error)

func (Client) GetInfo

func (c Client) GetInfo(section string) (map[string]string, error)

func (Client) HGetAll

func (c Client) HGetAll(key string, value interface{}) error

func (Client) HSet

func (c Client) HSet(key string, field string, value interface{}) error

func (Client) HmSet

func (c Client) HmSet(key string, kv map[string]interface{}) error

func (Client) Pipelining

func (c Client) Pipelining(cmds []PipeLiningCmd) []PipeLiningResult

func (Client) Scan

func (c Client) Scan(cursor *uint64, match string, limit uint64) ([]string, error)

func (Client) Select

func (c Client) Select(db uint64) error

func (Client) SerializedLength

func (c Client) SerializedLength(key string) (uint64, error)

func (Client) Set

func (c Client) Set(key string, value interface{}) error

func (Client) Setex

func (c Client) Setex(key string, expire int, value interface{}) error

func (Client) Ttl

func (c Client) Ttl(key string) (int64, error)

type Config

type Config struct {
	Host     string      `mapstructure:"host"`
	Port     uint16      `mapstructure:"port"`
	Password string      `mapstructure:"password"`
	Database uint        `mapstructure:"database"`
	Pool     *PoolConfig `mapstructure:"pool"`
}

func GetConfig

func GetConfig(conn string) (*Config, error)

func (Config) String

func (c Config) String() string

type PipeLiningCmd

type PipeLiningCmd struct {
	Cmd  string
	Args interface{}
}

type PipeLiningResult

type PipeLiningResult struct {
	Reply interface{}
	Error error
}

type PoolConfig

type PoolConfig struct {
	MaxIdle     int           `mapstructure:"max_idle"`
	MaxActive   int           `mapstructure:"max_active"`
	IdleTimeout time.Duration `mapstructure:"idle_timeout"`
}

Jump to

Keyboard shortcuts

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