Documentation ¶
Index ¶
- Constants
- func NewEvent(c *conf.Event) (mq.IMQ, error)
- type KafkaEvent
- type MqttEvent
- type MqttEventOption
- 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 ¶
View Source
const ( // DisconnectTime 断开重连时间 DisconnectTime uint = 250 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KafkaEvent ¶ added in v1.2.0
type KafkaEvent struct {
// contains filtered or unexported fields
}
KafkaEvent kafka event
func NewKafkaEvent ¶ added in v1.2.0
func NewKafkaEvent(c *conf.Kafka) (*KafkaEvent, error)
NewKafkaEvent 创建kafka event
func (*KafkaEvent) Receive ¶ added in v1.2.0
func (k *KafkaEvent) Receive(topic string) <-chan *mq.Msg
Receive 接收
func (*KafkaEvent) RemoveReceiver ¶ added in v1.2.0
func (k *KafkaEvent) RemoveReceiver(topic string)
RemoveReceiver 移除监听
type MqttEvent ¶ added in v1.2.0
type MqttEvent struct { DisconnectTime uint // contains filtered or unexported fields }
MqttEvent MQTT 事件
func NewMqttEvent ¶ added in v1.2.0
func NewMqttEvent(c *conf.MQTT, opts ...MqttEventOption) (*MqttEvent, error)
NewMqttEvent 创建MQTT 事件
func (*MqttEvent) RemoveReceiver ¶ added in v1.2.0
RemoveReceiver 移除接收者
type MqttEventOption ¶ added in v1.2.0
type MqttEventOption func(r *MqttEvent)
MqttEventOption 选项
func WithDisconnectTime ¶ added in v1.2.0
func WithDisconnectTime(quiesce uint) MqttEventOption
WithDisconnectTime 设置断开重连时间
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.