kafka

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func New

func New(params output.Params) (output.Output, error)

Types

type Config

type Config struct {
	// Connection.
	Brokers []string `json:"brokers" envconfig:"K6_KAFKA_BROKERS"`

	// Samples.
	Topic                 null.String        `json:"topic" envconfig:"K6_KAFKA_TOPIC"`
	User                  null.String        `json:"user" envconfig:"K6_KAFKA_SASL_USER"`
	Password              null.String        `json:"password" envconfig:"K6_KAFKA_SASL_PASSWORD"`
	AuthMechanism         null.String        `json:"authMechanism" envconfig:"K6_KAFKA_AUTH_MECHANISM"`
	Format                null.String        `json:"format" envconfig:"K6_KAFKA_FORMAT"`
	PushInterval          types.NullDuration `json:"pushInterval" envconfig:"K6_KAFKA_PUSH_INTERVAL"`
	Version               null.String        `json:"version" envconfig:"K6_KAFKA_VERSION"`
	SSL                   null.Bool          `json:"ssl" envconfig:"K6_KAFKA_SSL"`
	InsecureSkipTLSVerify null.Bool          `json:"insecureSkipTLSVerify" envconfig:"K6_KAFKA_INSECURE_SKIP_TLS_VERIFY"`
	LogError              null.Bool          `json:"logError" envconfig:"K6_KAFKA_LOG_ERROR"`

	InfluxDBConfig influxdbConfig `json:"influxdb"`
}

Config is the config for the kafka collector

func GetConsolidatedConfig

func GetConsolidatedConfig(jsonRawConf json.RawMessage, env map[string]string, arg string) (Config, error)

GetConsolidatedConfig combines {default config values + JSON config + environment vars + arg config values}, and returns the final result.

func NewConfig

func NewConfig() Config

NewConfig creates a new Config instance with default values for some fields.

func ParseArg

func ParseArg(arg string) (Config, error)

ParseArg takes an arg string and converts it to a config

func (Config) Apply

func (c Config) Apply(cfg Config) Config

type FieldKind

type FieldKind int

FieldKind defines Enum for tag-to-field type conversion

const (
	// String field (default)
	String FieldKind = iota
	// Int field
	Int
	// Float field
	Float
	// Bool field
	Bool
)

type Output

type Output struct {
	output.SampleBuffer

	Config  Config
	CloseFn func() error

	Producer sarama.AsyncProducer
	// contains filtered or unexported fields
}

func (*Output) Description

func (o *Output) Description() string

func (*Output) Start

func (o *Output) Start() error

func (*Output) Stop

func (o *Output) Stop() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL