Documentation ¶
Index ¶
- Variables
- func NewMsgBus(client IRedisClient) xmsgbus.IMsgBus
- func NewSharedStorage(client IRedisClient) xmsgbus.ISharedStorage
- type AckData
- type IRedisClient
- type MsgBus
- func (x *MsgBus) AddChannel(ctx context.Context, topic string, channel string) error
- func (x *MsgBus) ListChannel(ctx context.Context, topic string) ([]string, error)
- func (x *MsgBus) Pop(ctx context.Context, topic, channel string, blockTimeout time.Duration) ([]byte, func(), error)
- func (x *MsgBus) Push(ctx context.Context, topic string, bs []byte) error
- func (x *MsgBus) RemoveChannel(ctx context.Context, topic string, channel string) error
- type SharedStorage
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrRPushAndExpire = fmt.Errorf("RPushAndExpire failed")
)
Functions ¶
func NewMsgBus ¶
func NewMsgBus(client IRedisClient) xmsgbus.IMsgBus
func NewSharedStorage ¶
func NewSharedStorage(client IRedisClient) xmsgbus.ISharedStorage
Types ¶
type IRedisClient ¶
type IRedisClient interface { SAdd(ctx context.Context, key string, members ...interface{}) error SMembers(ctx context.Context, key string) ([]string, error) SRem(ctx context.Context, key string, members ...interface{}) error Get(ctx context.Context, key string) ([]byte, error) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) (string, error) SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) (bool, error) SetEX(ctx context.Context, key string, value interface{}, expiration time.Duration) error Keys(ctx context.Context, pattern string) ([]string, error) Del(ctx context.Context, keys ...string) error BLPop(ctx context.Context, timeout time.Duration, keys ...string) ([]string, error) RPushAndExpire(ctx context.Context, key string, value string, ttl time.Duration) error }
type MsgBus ¶
type MsgBus struct {
// contains filtered or unexported fields
}
func (*MsgBus) AddChannel ¶
func (*MsgBus) ListChannel ¶
type SharedStorage ¶
type SharedStorage struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.