Documentation ¶
Index ¶
- Constants
- type Config
- type Redis
- func (r *Redis) Del(key string) (interface{}, error)
- func (r *Redis) Get(key string) (interface{}, error)
- func (r *Redis) GetString(key string) (string, error)
- func (r *Redis) HGetAll(key string) (interface{}, error)
- func (r *Redis) HGetAllMap(key string) (map[string]string, error)
- func (r *Redis) HmSet(key string, val map[string]string) (interface{}, error)
- func (r *Redis) Ping() (bool, error)
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.Duration(5) * time.Minute DefaultRedisIdleTimeout = time.Duration(5) * time.Minute )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Network string Addr string Password string Database int MaxIdle int MaxActive int IdleTimeout time.Duration }
Config the redis configuration
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default redis configuration
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
A Redis model
func (*Redis) HGetAllMap ¶
HGetAllMap returns a map[string]string by key
Click to show internal directories.
Click to hide internal directories.