Documentation
¶
Index ¶
- func AddHeader(key string, value []byte) optparams.Option[kafka.Message]
- func ExtractHeaders(msg *kafka.Message) (map[string][]byte, error)
- func ExtractKey(msg *kafka.Message) ([]byte, error)
- func ExtractTopic(msg *kafka.Message) string
- func ExtractValue(msg *kafka.Message) ([]byte, error)
- func NewMsg(topic string, value []byte, opts ...optparams.Option[kafka.Message]) *kafka.Message
- func WithHeaders(headers map[string][]byte) optparams.Option[kafka.Message]
- func WithKey(key []byte) optparams.Option[kafka.Message]
- func WithPartition(partition int32) optparams.Option[kafka.Message]
- type ConciseMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractHeaders ¶
ExtractValue 从消息中获取headers字典 @params msg *kafka.Message 消息指针
func ExtractKey ¶
ExtractValue 从消息中获取key @params msg *kafka.Message 消息指针
func ExtractTopic ¶
ExtractTopic 从消息中获取来源的topic @params msg *kafka.Message 消息指针
func ExtractValue ¶
ExtractValue 从消息中获取value @params msg *kafka.Message 消息指针
func NewMsg ¶
NewMsg 构造消息用于发送 @params topic string 消息要发送去的topic @params value []byte 消息的值 @params opts ...optparams.Option[kafka.Message] 消息的其他设置
func WithHeaders ¶
WithHeaders 设置headers @params headers map[string][]byte header键值对
Types ¶
type ConciseMsg ¶
ConciseMsg 简化版本的消息对象,*kafka.Message信息过全,结构略复杂并不太利于利用
Click to show internal directories.
Click to hide internal directories.