config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBackendConfiguredNotValid = fmt.Errorf(
	"backend configured not valid, opts are: %s, %s", types.BackendGoChannels, types.BackendKafka)

Functions

This section is empty.

Types

type Config

type Config struct {
	Backend   types.Backend `json:"backend" yaml:"backend"`
	Kafka     Kafka         `json:"kafka" yaml:"kafka" validate:"required_if=Backend kafka"`
	GoChannel GoChannel     `json:"goChannel" yaml:"goChannel" validate:"required_if=Backend goChannel"`
}

func Default

func Default() *Config

func (*Config) Key

func (c *Config) Key() string

func (*Config) Validate

func (c *Config) Validate() error

type GoChannel

type GoChannel struct {
	OutputChannelBuffer int64 `json:"outputChannelBuffer" yaml:"outputChannelBuffer" validate:"omitempty,required,min=1024"`
	Persistent          bool  `json:"persistent" yaml:"persistent"`
}

type Kafka

type Kafka struct {
	Brokers []string `json:"brokers" yaml:"brokers" validate:"omitempty,min=1,dive,required"`

	// ConsumerGroup, when set, makes every handler consume as a member of a
	// Kafka consumer group named "<ConsumerGroup>.<handlerName>". That gives
	// each handler its own group: replicas of the same service share a
	// handler's messages instead of each receiving all of them, two handlers on
	// one topic still each see every message, and offsets are committed so a
	// restart resumes where the handler stopped.
	//
	// Empty keeps the original behaviour: no group, every replica reads every
	// message and nothing is committed.
	ConsumerGroup string `json:"consumerGroup" yaml:"consumerGroup"`
}

Jump to

Keyboard shortcuts

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