config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ConsumerGroupIDKey string = "group.id"
View Source
const ConsumerOffsetResetKey string = "auto.offset.reset"
View Source
const EnableAutoCommit string = "enable.auto.commit"
View Source
const KafkaBootstrapServerKey string = "bootstrap.servers"
View Source
const SSLCALocation string = "ssl.ca.location"
View Source
const SSLCertLocation string = "ssl.certificate.location"
View Source
const SSLCertificateLocation string = "ssl.certificate.location"
View Source
const SSLKeyLocation string = "ssl.key.location"
View Source
const SSLKeyPassword string = "ssl.key.password"
View Source
const SecurityProtocol string = "security.protocol"

Variables

This section is empty.

Functions

func Load

func Load() error

Types

type Application

type Application struct {
	Producer
	Consumer
	Config
	Reporter
	Store
}

func App

func App() Application

func (Application) DevEnvironment

func (a Application) DevEnvironment() bool

func (Application) LogLevel

func (a Application) LogLevel() string

func (Application) RunDuration

func (a Application) RunDuration() time.Duration

type Config

type Config struct {
	Environment string `default:"production"`
	DurationMs  int64  `split_words:"true" default:"10000"`
}

type Consumer

type Consumer struct {
	// TODO: remove tags and load with split words while processing
	Enabled          bool   `default:"true"`
	Topic            string `default:"kafqa_test" envconfig:"KAFKA_TOPIC"`
	Concurrency      int    `default:"20"`
	KafkaBrokers     string `split_words:"true" required:"true"`
	GroupID          string `split_words:"true" default:"kafqa_test_consumer"`
	OffsetReset      string `split_words:"true" default:"latest"`
	PollTimeoutMs    int64  `split_words:"true" default:"500"`
	SecurityProtocol string `split_words:"true" default:"PLAINTEXT"`
	EnableAutoCommit bool   `split_words:"true" default:"true"`
	// contains filtered or unexported fields
}

func (Consumer) KafkaConfig

func (c Consumer) KafkaConfig() *kafka.ConfigMap

func (Consumer) PollTimeout

func (c Consumer) PollTimeout() time.Duration

type Producer

type Producer struct {
	Enabled          bool   `default:"true"`
	Topic            string `default:"kafqa_test" envconfig:"KAFKA_TOPIC"`
	Concurrency      int    `default:"100"`
	TotalMessages    uint64 `split_words:"true" default:"10000"`
	KafkaBrokers     string `split_words:"true" required:"true"`
	FlushTimeoutMs   int    `split_words:"true" default:"2000"`
	SecurityProtocol string `split_words:"true" default:"PLAINTEXT"`

	DelayMs       int `split_words:"true" default:"1000"`
	WorkerDelayMs int `split_words:"true" default:"50"`
	// contains filtered or unexported fields
}

func (Producer) KafkaConfig

func (p Producer) KafkaConfig() *kafka.ConfigMap

type Prometheus

type Prometheus struct {
	Enabled    bool   `default:"false"`
	Port       int    `default:"9999"`
	PodName    string `split_words:"true"`
	Deployment string
}

func (Prometheus) BindPort

func (p Prometheus) BindPort() string

type Reporter

type Reporter struct {
	Prometheus
}

type SSL

type SSL struct {
	CALocation          string `split_words:"true"`
	CertificateLocation string `split_words:"true"`
	KeyLocation         string `split_words:"true"`
	KeyPassword         string `split_words:"true"`
}

type Store

type Store struct {
	Type      string `default:"memory"`
	RunID     string `split_words:"true"`
	RedisHost string `split_words:"true"`
}

Jump to

Keyboard shortcuts

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