Documentation ¶
Overview ¶
* @Author: liziwei01 * @Date: 2022-03-04 15:43:21 * @LastEditors: liziwei01 * @LastEditTime: 2022-04-12 15:19:09 * @Description: file content
* @Author: liziwei01 * @Date: 2022-03-04 13:52:11 * @LastEditors: liziwei01 * @LastEditTime: 2023-03-30 23:20:38 * @Description: file content
* @Author: liziwei01 * @Date: 2022-03-04 15:42:58 * @LastEditors: liziwei01 * @LastEditTime: 2023-03-30 23:16:33 * @Description: file content
* @Author: liziwei01 * @Date: 2022-03-21 22:36:04 * @LastEditors: liziwei01 * @LastEditTime: 2022-04-24 21:37:52 * @Description: file content
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // GetStr 获取value Get(ctx context.Context, key string) (value string, err error) // Set 将字符串值 value 关联到 key // 如果 key 已经存在, SET 将覆盖旧值 无视类型 // 过期时间为 nanoseconds 纳秒 Set(ctx context.Context, key string, value string, expireTime ...time.Duration) error // Del Del(ctx context.Context, keys ...string) error // Determine if a key exists Exists(ctx context.Context, keys ...string) (bool, error) // contains filtered or unexported methods }
type Config ¶
type Config struct { // Service的名字, 必选 Name string // 各种自定义的参数, 全部非必选 // 写数据超时 WriteTimeOut int // 读数据超时 ReadTimeOut int // 请求失败后的重试次数: 总请求次数 = Retry + 1 Retry int // 资源定位: 手动配置 - 使用IP、端口 Resource struct { Manual struct { Host string Port int } } Redis struct { Password string DB int } }
Config 配置
Click to show internal directories.
Click to hide internal directories.