Documentation ¶
Index ¶
- Constants
- func AddSHeader(msg *KafkaMessage, key string, value string)
- func AddSXOrigin(msg *KafkaMessage)
- func AddSXTrace(msg *KafkaMessage) error
- func GetSHeader(msg *KafkaMessage, key string) (bool, string)
- func GetSXOrigin(msg *KafkaMessage) (bool, string)
- func IsInTrace(msg *KafkaMessage) bool
- func IsSameOrigin(msg *KafkaMessage) bool
- func ToConsumerMessage(message *KafkaMessage) *sarama.ConsumerMessage
- func ToProducerMessage(message *KafkaMessage) *sarama.ProducerMessage
- type KafkaMessage
- type TraceValue
Constants ¶
View Source
const CycleTime = 100
Variables ¶
This section is empty.
Functions ¶
func AddSHeader ¶ added in v0.0.4
func AddSHeader(msg *KafkaMessage, key string, value string)
func AddSXOrigin ¶ added in v0.0.4
func AddSXOrigin(msg *KafkaMessage)
func AddSXTrace ¶ added in v0.0.4
func AddSXTrace(msg *KafkaMessage) error
func GetSHeader ¶ added in v0.0.4
func GetSHeader(msg *KafkaMessage, key string) (bool, string)
func GetSXOrigin ¶ added in v0.0.4
func GetSXOrigin(msg *KafkaMessage) (bool, string)
func IsInTrace ¶ added in v0.0.4
func IsInTrace(msg *KafkaMessage) bool
func IsSameOrigin ¶ added in v0.0.4
func IsSameOrigin(msg *KafkaMessage) bool
func ToConsumerMessage ¶
func ToConsumerMessage(message *KafkaMessage) *sarama.ConsumerMessage
ToConsumerMessage converts a KafkaMessage to a sarama.ConsumerMessage.
func ToProducerMessage ¶
func ToProducerMessage(message *KafkaMessage) *sarama.ProducerMessage
ToProducerMessage converts a KafkaMessage to a sarama.ProducerMessage. It ignores the Partition and Offset fields and sets trace headers.
Types ¶
type KafkaMessage ¶
type KafkaMessage struct { Headers map[string]string `json:"headers"` Topic string `json:"topic"` Key []byte `json:"key"` Value []byte `json:"value"` Offset int64 `json:"offset"` Partition int32 `json:"partition"` }
KafkaMessage represents a message in the Kafka queue.
func FromConsumerMessage ¶
func FromConsumerMessage(message *sarama.ConsumerMessage) *KafkaMessage
FromConsumerMessage converts a sarama.ConsumerMessage to a KafkaMessage.
type TraceValue ¶
func GetSXTrace ¶ added in v0.0.4
func GetSXTrace(msg *KafkaMessage) (bool, TraceValue)
Click to show internal directories.
Click to hide internal directories.