Documentation
¶
Overview ¶
Redis
Index ¶
- type Redis
- func (r *Redis) Connect() (rdb *Redis, ctx context.Context, cancel context.CancelFunc)
- func (r *Redis) IncrX(ctx context.Context, key string, expire uint32) (val uint32, err error)
- func (r *Redis) StreamGroupConsumerCreate(streamKey string, groupName string, consumerName string) (err error)
- func (r *Redis) StreamGroupCreate(streamKey string, groupName string, beginMsgId string) (err error)
- func (r *Redis) StreamMessageAdd(streamKey string, maxLen int64, values string) (msgId string, err error)
- func (r *Redis) StreamMessageByGroupConsumer(streamKey string, groupName string, consumerName string, count int64, ...) (messages map[string]string, err error)
- func (r *Redis) StreamXAck(streamKey string, groupName string, vecMsgId []string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Redis ¶
type Redis struct {
Host string `mapstructure:"Host"` // 连接地址
Port int32 `mapstructure:"Port"` // 连接地址
Password string `mapstructure:"Password"` // 密码
Index int32 `mapstructure:"Index"` // 数据库
PoolSize int32 `mapstructure:"PoolSize"` // 连接池大小
Timeout int32 `mapstructure:"Timeout"` // 超时时间
KeyNil error // 定义键不存在错误,避免业务中导入redis包
*redis.Client
}
Redis配置
func (*Redis) StreamGroupConsumerCreate ¶
func (r *Redis) StreamGroupConsumerCreate(streamKey string, groupName string, consumerName string) (err error)
组消费者创建
func (*Redis) StreamGroupCreate ¶
func (r *Redis) StreamGroupCreate(streamKey string, groupName string, beginMsgId string) (err error)
消费者组创建
func (*Redis) StreamMessageAdd ¶
func (r *Redis) StreamMessageAdd(streamKey string, maxLen int64, values string) (msgId string, err error)
消息添加
Click to show internal directories.
Click to hide internal directories.