config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ConsumerGroupIDKey string = "group.id"
View Source
const ConsumerOffsetResetKey string = "auto.offset.reset"
View Source
const ConsumerQueuedMinMessages string = "queued.min.messages"
View Source
const EnableAutoCommit string = "enable.auto.commit"
View Source
const KafkaBootstrapServerKey string = "bootstrap.servers"
View Source
const LibrdStatisticsIntervalMs string = "statistics.interval.ms"
View Source
const ProduceRequestRequiredAcks string = "request.required.acks"
View Source
const ProducerBatchNumMessages string = "batch.num.messages"
View Source
const ProducerQueueBufferingMaxMessages string = "queue.buffering.max.messages"
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

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"`
	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"`
	WorkerDelayMs    int    `split_words:"true" default:"0"`

	LibrdConfigs LibrdConfigs
	// contains filtered or unexported fields
}

func (Consumer) KafkaConfig

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

func (Consumer) MessageLoopDelay

func (c Consumer) MessageLoopDelay() time.Duration

func (Consumer) PollTimeout

func (c Consumer) PollTimeout() time.Duration

type Jaeger

type Jaeger struct {
	Disabled         bool    `default:"true"`
	ServiceName      string  `split_words:"true" default:"kafqa"`
	ReporterLogSpans bool    `split_words:"true" default:"false"`
	SamplerType      string  `split_words:"true" default:"const"`
	SamplerParam     float64 `split_words:"true" default:"1"`
	AgentPort        int     `split_words:"true" default:"6831"`
	AgentHost        string  `split_words:"true" default:"localhost"`
}

func (Jaeger) AgentHostPort

func (j Jaeger) AgentHostPort() string

type LibrdConfigs

type LibrdConfigs struct {
	Enabled                  bool `default:"false"`
	QueueBufferingMaxMessage int  `split_words:"true" default:"100000"`
	BatchNumMessages         int  `split_words:"true" default:"10000"`
	QueuedMinMessages        int  `split_words:"true" default:"10000"`
	RequestRequiredAcks      int  `split_words:"true" default:"1"`
	StatisticsIntervalMs     int  `split_words:"true" default:"500"`
}

type PProf

type PProf struct {
	Enabled    bool   `default:"false"`
	Port       int    `default:"9998"`
	PodName    string `envconfig:"POD_NAME"`
	Deployment string `envconfig:"DEPLOYMENT"`
}

type Producer

type Producer struct {
	Enabled          bool   `default:"true"`
	Topic            string `default:"kafqa_test" envconfig:"KAFKA_TOPIC"`
	Concurrency      int    `default:"100"`
	TotalMessages    int64  `split_words:"true" default:"10000"`
	KafkaBrokers     string `split_words:"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"`
	Acks          int `default:"1"`
	Librdconfigs  LibrdConfigs
	ClusterName   string `envconfig:"KAFKA_CLUSTER"`
	// 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 `envconfig:"POD_NAME"`
	Deployment string `envconfig:"DEPLOYMENT"`
}

func (Prometheus) BindPort

func (p Prometheus) BindPort() string

type ProtoParser

type ProtoParser struct {
	Enabled        bool   `default:"false"`
	FilePath       string `split_words:"true"`
	MessageName    string `split_words:"true"`
	TimestampIndex int    `split_words:"true"`
}

type Reporter

type Reporter struct {
	Prometheus
	Statsd
	PProf
}

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 Statsd

type Statsd struct {
	Host       string
	Port       int
	Enabled    bool   `default:"false"`
	PodName    string `envconfig:"POD_NAME"`
	Deployment string `envconfig:"DEPLOYMENT"`
	Tags       []string
}

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