Documentation ¶
Index ¶
- func NewEvent(c *conf.MQ) (mq.IMQ, error)
- type RocketMQEvent
- func (r *RocketMQEvent) Close()
- func (r *RocketMQEvent) ConvertMessageView(ctx context.Context, topic string, messages []*golang.MessageView) []*mq.Msg
- func (r *RocketMQEvent) Receive(topic string) <-chan *mq.Msg
- func (r *RocketMQEvent) RemoveReceiver(topic string)
- func (r *RocketMQEvent) Send(_ string, _ []byte) error
- type RocketMQEventOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RocketMQEvent ¶
type RocketMQEvent struct {
// contains filtered or unexported fields
}
RocketMQEvent RocketMQ事件
func NewRocketMQEvent ¶
func NewRocketMQEvent(c *conf.RocketMQ, opts ...RocketMQEventOption) (*RocketMQEvent, error)
NewRocketMQEvent 创建RocketMQ事件
func (*RocketMQEvent) ConvertMessageView ¶
func (r *RocketMQEvent) ConvertMessageView(ctx context.Context, topic string, messages []*golang.MessageView) []*mq.Msg
ConvertMessageView 转换消息视图
func (*RocketMQEvent) Receive ¶
func (r *RocketMQEvent) Receive(topic string) <-chan *mq.Msg
Receive 监听topic
func (*RocketMQEvent) RemoveReceiver ¶
func (r *RocketMQEvent) RemoveReceiver(topic string)
RemoveReceiver 移除监听
type RocketMQEventOption ¶
type RocketMQEventOption func(r *RocketMQEvent)
RocketMQEventOption 选项
func WithAwaitDuration ¶
func WithAwaitDuration(d time.Duration) RocketMQEventOption
WithAwaitDuration 设置等待时间
func WithInvisibleDuration ¶
func WithInvisibleDuration(d time.Duration) RocketMQEventOption
WithInvisibleDuration 设置不可见时间
func WithMaxMessageNum ¶
func WithMaxMessageNum(n int32) RocketMQEventOption
WithMaxMessageNum 设置最大消息数
Click to show internal directories.
Click to hide internal directories.