Documentation ¶
Index ¶
Constants ¶
View Source
const (
// INF for Infinity
INF = "+inf"
)
Variables ¶
View Source
var ConfigPrefix = "REDIS"
ConfigPrefix define configuration prefix
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { Logger logger.Logger `ignored:"true" json:"-"` Host string `default:"0.0.0.0" envconfig:"HOST"` Port int `default:"6379" envconfig:"PORT"` Password string `default:"" envconfig:"PASSWORD"` Database int `default:"0" envconfig:"DATABASE"` PingDelay time.Duration `default:"2s" envconfig:"PING_DELAY"` KeyPrefix string `default:"" envconfig:"KEY_PREFIX"` }
Options represents Redis options
type Redis ¶
type Redis interface { Connect() Disconnect() error Increment(string) (int64, error) Decrement(string) (int64, error) Set(string, string, time.Duration) error Get(string) (string, error) Del(string) (int64, error) Exists(string) (int64, error) SearchByKey(string) ([]string, error) SetMemberAdd(string, ...string) error SetMemberExists(string, string) (bool, error) SetMemberDelete(string, string) (int64, error) SetMembers(string) ([]string, error) SetLength(string) (int64, error) HashItemAdd(string, string, string) error HashItemExists(string, string) (bool, error) HashItemGet(string, string) (string, error) HashItemDelete(string, string) (int64, error) HashItems(string) (map[string]string, error) HashLength(string) (int64, error) ScoreItemAdd(string, float64, string) error ScoreItemCount(string, string, string) (float64, error) PubSubPublish(string, string) error PubSubSubscribe(string, chan<- string) error FlushAll() error }
Redis represents the Redis interface
Click to show internal directories.
Click to hide internal directories.