Documentation
¶
Overview ¶
@Author Chen_dark @Date 2024/10/31 11:16:00 @Desc
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) Del(ctx context.Context, key string) error
- func (c *Client) Eval(ctx context.Context, src string, keyCount int, keysAndArgs []interface{}) (interface{}, error)
- func (c *Client) Get(ctx context.Context, key string) (string, error)
- func (c *Client) GetConn(ctx context.Context) (redis.Conn, error)
- func (c *Client) Incr(ctx context.Context, key string) (int64, error)
- func (c *Client) Set(ctx context.Context, key, value string) (int64, error)
- func (c *Client) SetNEX(ctx context.Context, key, value string, expireSeconds int64) (int64, error)
- func (c *Client) SetNX(ctx context.Context, key, value string) (int64, error)
- func (c *Client) XACK(ctx context.Context, topic, groupID, msgID string) error
- func (c *Client) XADD(ctx context.Context, topic string, maxLen int, key, val string) (string, error)
- func (c *Client) XADDJson(ctx context.Context, topic string, maxLen int, key, val string) (string, error)
- func (c *Client) XGroupCreate(ctx context.Context, topic, group string) (string, error)
- func (c *Client) XReadGroup(ctx context.Context, groupID, consumerID, topic string, timeoutMiliSeconds int) ([]*MsgEntity, error)
- func (c *Client) XReadGroupPending(ctx context.Context, groupID, consumerID, topic string) ([]*MsgEntity, error)
- type ClientOption
- type ClientOptions
- type Config
- type ConsumerConfig
- type MsgEntity
- type ProducerConfig
Constants ¶
View Source
const ( // 默认连接池超过 10 s 释放连接 DefaultIdleTimeoutSeconds = 10 // 默认最大激活连接数 DefaultMaxActive = 100 // 默认最大空闲连接数 DefaultMaxIdle = 20 )
Variables ¶
View Source
var ErrNoMsg = errors.New("no msg received")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client Redis 客户端.
func NewClientWithPool ¶
func NewClientWithPool(pool *redis.Pool, opts ...ClientOption) *Client
func (*Client) Eval ¶
func (c *Client) Eval(ctx context.Context, src string, keyCount int, keysAndArgs []interface{}) (interface{}, error)
Eval 支持使用 lua 脚本.
func (*Client) XGroupCreate ¶
func (*Client) XReadGroup ¶
type ClientOption ¶
type ClientOption func(c *ClientOptions)
func WithIdleTimeoutSeconds ¶
func WithIdleTimeoutSeconds(idleTimeoutSeconds int) ClientOption
func WithMaxActive ¶
func WithMaxActive(maxActive int) ClientOption
func WithMaxIdle ¶
func WithMaxIdle(maxIdle int) ClientOption
func WithWaitMode ¶
func WithWaitMode() ClientOption
type ClientOptions ¶
type ClientOptions struct {
// contains filtered or unexported fields
}
type ConsumerConfig ¶
type ProducerConfig ¶
Click to show internal directories.
Click to hide internal directories.