Documentation ¶
Index ¶
Constants ¶
const ( // OffsetOldest represents oldest offset in Kafka OffsetOldest Offset = -1 // OffsetNewest represents newest offset in Kafka OffsetNewest = -2 // ProtocolPlain represents graphite line protocol ProtocolPlain Protocol = 0 // ProtocolProtobuf represents protobuf messages ProtocolProtobuf = 1 // ProtocolPickle represents pickled messages ProtocolPickle = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Duration ¶
Duration wrapper time.Duration for TOML
func (*Duration) MarshalText ¶
MarshalText encode text with TOML format
func (*Duration) UnmarshalText ¶
UnmarshalText from TOML
type Kafka ¶
Kafka receive metrics in protobuf or graphite line format from Kafka partitions
func (*Kafka) InitPrometheus ¶
func (rcv *Kafka) InitPrometheus(reg prometheus.Registerer)
InitPrometheus is a stub for the receiver prom metrics. Required to satisfy Receiver interface.
func (*Kafka) Stat ¶
func (rcv *Kafka) Stat(send helper.StatCallback)
Stat sends kafka receiver's internal stats to specified callback
type Offset ¶
type Offset int64
Offset is a special type to define kafka offsets. It's used to create custom marshal/unmarshal functions for configs.
func (*Offset) MarshalText ¶
MarshalText marshals offset. It's used to handle two special cases "newest" and "oldest".
func (*Offset) UnmarshalText ¶
UnmarshalText unmarshals text to offset. It handles "newest" and "oldest", oterwise fallbacks to time.ParseDuration.
type Options ¶
type Options struct { Brokers []string `toml:"brokers"` Topic string `toml:"topic"` Partition int32 `toml:"partition"` Protocol Protocol `toml:"parse-protocol"` StateFile string `toml:"state-file"` InitialOffset Offset `toml:"initial-offset"` StateSaveInterval *Duration `toml:"state-save-interval"` ReconnectInterval *Duration `toml:"reconnect-interval"` FetchInterval *Duration `toml:"fetch-interval"` KafkaVersion string `toml:"kafka-version"` }
Options contains all receiver's options that can be changed by user
func NewOptions ¶
func NewOptions() *Options
NewOptions returns Options struct filled with default values.
type Protocol ¶
type Protocol int
Protocol is a special type to allow user to define wire protocol in Config file as a simple text.
func (*Protocol) MarshalText ¶
MarshalText converts internal enum-like representation of protocol to a text
func (*Protocol) UnmarshalText ¶
UnmarshalText converts text from config file to a enum.