Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ProducerMessagePool = sync.Pool{ New: func() interface{} { return &sarama.ProducerMessage{} }, }
Functions ¶
func GetSaramaProducer ¶
func GetSaramaProducer(topic string, partition int32, value []byte) *sarama.ProducerMessage
Types ¶
type Config ¶
type Config struct { // Common Name string `json:"Name"` Type Transport Compression string `json:"Compression"` DistributionAlgorithm distribution.Algorithm Encoding OutputEncoding FlushFrequency time.Duration `json:"FlushFrequency"` ChannelBufferSize int `json:"ChannelBufferSize"` TLS TLSConfig `json:"TLS"` Buffered bool `json:"Buffered"` // Kafka Transport Brokers []string `json:"Brokers"` RequiredAcks sarama.RequiredAcks `json:"RequiredAcks"` RetryMax int `json:"RetryMax"` Topic string `json:"Topic"` Shards int `json:"Shards"` Partition int32 `json:"Partition"` // OrganisationID int // TCP Transport Servers []string CompressionLevel int `json:"CompressionLevel"` }
TODO: Find out reason why Viper ignores custom unmarshal functions and remove workaround from below
func (*Config) FromParsed ¶
func (c *Config) FromParsed(cfg ConfigForFile) error
type ConfigForFile ¶
type ConfigForFile struct { // Common Name string `json:"Name"` Type string `json:"Type"` Compression string `json:"Compression"` DistributionAlgorithm string `json:"DistributionAlgorithm"` Encoding string `json:"Encoding"` FlushFrequency time.Duration `json:"FlushFrequency"` ChannelBufferSize int `json:"ChannelBufferSize"` TLS TLSConfig `json:"TLS"` Buffered bool `json:"Buffered"` // Kafka Transport Brokers []string `json:"Brokers"` RequiredAcks sarama.RequiredAcks `json:"RequiredAcks"` RetryMax int `json:"RetryMax"` Topic string `json:"Topic"` Shards int `json:"Shards"` Partition int32 `json:"Partition"` // OrganisationID int // TCP Transport Servers []string CompressionLevel int `json:"CompressionLevel"` }
type OutputEncoding ¶
type OutputEncoding int
const ( GraphiteLineEncoding OutputEncoding = iota ProtobufEncoding JsonEncoding )
func (*OutputEncoding) FromString ¶
func (e *OutputEncoding) FromString(s string) error
func (*OutputEncoding) MarshalJSON ¶
func (e *OutputEncoding) MarshalJSON() ([]byte, error)
func (OutputEncoding) String ¶
func (e OutputEncoding) String() string
func (*OutputEncoding) UnmarshalJSON ¶
func (e *OutputEncoding) UnmarshalJSON(data []byte) error
func (*OutputEncoding) UnmarshalYAML ¶
func (e *OutputEncoding) UnmarshalYAML(unmarshal func(interface{}) error) error
type Transport ¶
type Transport int
func (*Transport) FromString ¶
func (*Transport) MarshalJSON ¶
func (*Transport) UnmarshalJSON ¶
func (*Transport) UnmarshalYAML ¶
Click to show internal directories.
Click to hide internal directories.