config

package
v0.0.0-...-d0b7e3c Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterConfig

type ClusterConfig struct {
	Brokers     []string   `yaml:"brokers"`
	TopicFilter string     `yaml:"topicFilter"`
	TLS         TLSConfig  `yaml:"tls"`
	SASL        SASLConfig `yaml:"sasl"`
	// contains filtered or unexported fields
}

func (*ClusterConfig) GetCredentials

func (c *ClusterConfig) GetCredentials() *SASLCredentials

func (*ClusterConfig) LoadSASLCredentials

func (c *ClusterConfig) LoadSASLCredentials(clusterName string) error

type Config

type Config struct {
	Global   GlobalConfig             `yaml:"global"`
	Log      LogConfig                `yaml:"log"`
	Kafka    KafkaConfig              `yaml:"kafka"`
	Clusters map[string]ClusterConfig `yaml:"clusters"`
}

Config represents the application configuration

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig loads and validates the configuration

type GlobalConfig

type GlobalConfig struct {
	Port    string        `yaml:"port"`
	Timeout time.Duration `yaml:"timeout"`
}

type KafkaConfig

type KafkaConfig struct {
	DefaultRefreshRate time.Duration `yaml:"defaultRefreshRate"`
	MinKafkaVersion    string        `yaml:"minKafkaVersion"`
	AdminTimeout       time.Duration `yaml:"adminTimeout"`
}

type LogConfig

type LogConfig struct {
	Format string `yaml:"format"`
	Level  string `yaml:"level"`
}

type RuntimeSASLConfig

type RuntimeSASLConfig struct {
	Enabled   bool
	Username  string
	Password  string
	Mechanism string
}

type SASLConfig

type SASLConfig struct {
	Enabled     bool   `yaml:"enabled"`
	UsernameEnv string `yaml:"usernameEnv"`
	PasswordEnv string `yaml:"passwordEnv"`
	Mechanism   string `yaml:"mechanism"`
}

type SASLCredentials

type SASLCredentials struct {
	Enabled   bool
	Username  string
	Password  string
	Mechanism string
}

type TLSConfig

type TLSConfig struct {
	Enabled    bool   `yaml:"enabled"`
	CACert     string `yaml:"caCert"`
	ClientCert string `yaml:"clientCert"`
	ClientKey  string `yaml:"clientKey"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳