Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultBrokerAddr = "localhost:9092" // The default broker address to use if no broker addresses are specified. DefaultBufferSize = 1024 DefaultNumProducers = 1 DefaultNumWorkers = 2 )
The default option values.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
Log is a logger that sends log messages to Kafka.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option sets options on a Kafka logger.
func AddBrokerAddr ¶
AddBrokerAddr adds the given addresses to the slice of Kafka broker address. Broker addresses should be in the format "hostname:port". DefaultBrokerAddr if and only if no broker addresses are added.
func NumProducers ¶
NumProducers sets the number of Kafka producers to create.
func NumWorkers ¶
NumWorkers sets the number of workers to create. The workers are responsible for feeding log messages to the Kafka producers. A good rule of thumb is to create twice as many workers as producers.
Click to show internal directories.
Click to hide internal directories.