Documentation
¶
Overview ¶
Package producer exposes common logic that all Go collectors can use for producing nerd events
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Addresses []string `json:"addresses"` Timeout time.Duration `json:"timeout"` Topic string `json:"topic"` Type string `json:"type"` }
Config holds the necessary configuration to set up a producer
type KafkaProducer ¶
type KafkaProducer struct {
// contains filtered or unexported fields
}
KafkaProducer is a Producer implementation for sending events through a Kafka topic
func NewKafkaProducer ¶
func NewKafkaProducer(conf Config) (*KafkaProducer, error)
NewKafkaProducer checks the provided addresses and creates a Kafka producer
func (*KafkaProducer) Close ¶
func (kp *KafkaProducer) Close()
Close shuts down the underlying Kafka writer
type RestProducer ¶
type RestProducer struct {
// contains filtered or unexported fields
}
RestProducer is a Producer implementation for sending events directly to nerd through its API. Its use is discouraged when pairing it with a production nerd setup given that it doesn't support load balancing by series ID
func NewRestProducer ¶
func NewRestProducer(conf Config) (*RestProducer, error)
NewRestProducer checks the provided addresses and creates a rest producer
func (*RestProducer) Close ¶
func (rp *RestProducer) Close()
Close is required to be defined to comply with the Producer interface but not really needed for rest