Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuiltinRedis ¶
type BuiltinRedis interface { NewClient(cfg redis.Options) (*redis.Client, error) DefaultClient() (*redis.Client, error) StopAndClose() }
BuiltinRedis represents the redis runing on localhost, connected via a socket remember to `StopAndClose` it after the program exit
func New ¶
func New(opt Option) (_ BuiltinRedis, err error)
New will first download the redis and init the config if anything goes wrong at the statup stage, return error however, if the redis-server exit for 3 times, library will panic, means the builtin redis is not avaliable
type Option ¶
type Option struct { MuteLog bool // Set a memory usage limit to the specified amount of bytes. // When the memory limit is reached Redis will try to remove keys // according to the eviction policy selected (see maxmemory-policy). Memory string `default:"3gb"` // redis max memory CPUAffinity bool `yaml:"cpu-affinity"` Config map[string]string `yaml:"config"` // other configs, kv pair }
Option to config the builtin redis
Click to show internal directories.
Click to hide internal directories.