Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache interface { // SetMaxMemory size : 1KB 100KB 1M 2MB 1GB SetMaxMemory(size string) bool Set(key string, val any, expire time.Duration) error Get(key string, result any) error Del(key string) bool Exists(key string) bool Clear() bool // Keys 获取所有缓存中 key 的数量 Keys() int64 }
func DefaultCache ¶
type LocalCacheConf ¶
type RedisConf ¶
type RedisConf struct { Addrs []string `mapstructure:"addrs"` // [127.0.0.1:6379, 127.0.0.1:7000] Username string `mapstructure:"username"` Password string `mapstructure:"password" mask:""` DB uint8 `mapstructure:"db"` PoolSize int `mapstructure:"poolSize" yaml:"poolSize"` ReadTimeout types.Duration `mapstructure:"readTimeout" yaml:"readTimeout"` // 0.2s WriteTimeout types.Duration `mapstructure:"writeTimeout" yaml:"writeTimeout"` // 0.2s }
Click to show internal directories.
Click to hide internal directories.