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 * time.Millisecond
CycleTime is the default cycle time for loops. It is used in the consumer and producer.
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 Topic string Key []byte Value []byte Offset int64 Partition int32 }
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.