redis

package
v0.0.0-...-4b55cb2 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToStruct

func ConvertToStruct(v, out interface{}) error

func ToMap

func ToMap(s interface{}) (map[string]interface{}, error)

func ToStruct

func ToStruct(data interface{}, v interface{}) error
func CloneMap(i map[string]interface{}) map[string]interface{} {
	ret := make(map[string]interface{})
	for k, v := range i {
		ret[k] = v
	}
	return ret
}

Types

type Client

type Client struct {
	Address      string
	Password     string
	DialTimeout  int
	ReadTimeout  int
	WriteTimeout int
	PoolSize     int
	// contains filtered or unexported fields
}

func NewClient

func NewClient(address, password string, dialTime, readTime, writeTime, poolSize int) *Client

func (*Client) Close

func (c *Client) Close() error

func (*Client) Delete

func (c *Client) Delete(key string) error

func (*Client) Expire

func (c *Client) Expire(key string, expiration time.Duration) (bool, error)

func (*Client) Get

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

func (*Client) HDel

func (c *Client) HDel(key string, field string) error

func (*Client) HGetAll

func (c *Client) HGetAll(key string) (map[string]string, error)

func (*Client) HGetAllWithStruct

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

func (*Client) HMGet

func (c *Client) HMGet(key string, fields ...string) ([]interface{}, error)

func (*Client) HMSet

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

func (*Client) HMSetWithExpire

func (c *Client) HMSetWithExpire(key string, expire time.Duration, value interface{}) error

func (*Client) Open

func (c *Client) Open() error

func (*Client) SAdd

func (c *Client) SAdd(key string, members ...interface{}) error

func (*Client) SAddWithExpire

func (c *Client) SAddWithExpire(key string, expire time.Duration, members ...interface{}) error

func (*Client) SMembers

func (c *Client) SMembers(key string) ([]string, error)

func (*Client) Set

func (c *Client) Set(key string, val interface{}, expiration time.Duration) error

func (*Client) SetNX

func (c *Client) SetNX(key string, val interface{}, expiration time.Duration) error

type ClusterClient

type ClusterClient struct {
	Address      string
	Password     string
	DialTimeout  int
	ReadTimeout  int
	WriteTimeout int
	PoolSize     int
	// contains filtered or unexported fields
}

func NewClusterClient

func NewClusterClient(address, password string, dialTime, readTime, writeTime, poolSize int) *ClusterClient

func (*ClusterClient) Close

func (c *ClusterClient) Close() error

func (*ClusterClient) Delete

func (c *ClusterClient) Delete(key string) error

func (*ClusterClient) Expire

func (c *ClusterClient) Expire(key string, expiration time.Duration) (bool, error)

func (*ClusterClient) Get

func (c *ClusterClient) Get(key string) (string, error)

func (*ClusterClient) HDel

func (c *ClusterClient) HDel(key string, field string) error

func (*ClusterClient) HGetAll

func (c *ClusterClient) HGetAll(key string) (map[string]string, error)

func (*ClusterClient) HGetAllWithStruct

func (c *ClusterClient) HGetAllWithStruct(key string, value interface{}) error

func (*ClusterClient) HMGet

func (c *ClusterClient) HMGet(key string, fields ...string) ([]interface{}, error)

func (*ClusterClient) HMSet

func (c *ClusterClient) HMSet(key string, value interface{}) error

func (*ClusterClient) HMSetWithExpire

func (c *ClusterClient) HMSetWithExpire(key string, expire time.Duration, value interface{}) error

func (*ClusterClient) Open

func (c *ClusterClient) Open() error

func (*ClusterClient) SAdd

func (c *ClusterClient) SAdd(key string, members ...interface{}) error

func (*ClusterClient) SAddWithExpire

func (c *ClusterClient) SAddWithExpire(key string, expire time.Duration, members ...interface{}) error

func (*ClusterClient) SMembers

func (c *ClusterClient) SMembers(key string) ([]string, error)

func (*ClusterClient) Set

func (c *ClusterClient) Set(key string, val interface{}, expiration time.Duration) error

func (*ClusterClient) SetNX

func (c *ClusterClient) SetNX(key string, val interface{}, expiration time.Duration) error

Jump to

Keyboard shortcuts

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