config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ClusterName     string               `yaml:"clusterName"`
	TargetNamespace string               `yaml:"namespace"`
	MaxEventAge     time.Duration        `yaml:"maxEventAge"`
	BufferSize      int                  `yaml:"bufferSize"`
	Kafka           *KafkaConfig         `yaml:"kafka"`
	Filters         []processor.Filter   `yaml:"filters"`
	Selectors       []processor.Selector `yaml:"selectors"`
}

func Read

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

func (*Config) GetCluster

func (c *Config) GetCluster() kube.Cluster

func (*Config) SetDefaults

func (c *Config) SetDefaults()

func (*Config) Validate

func (c *Config) Validate() error

type KafkaConfig

type KafkaConfig struct {
	Brokers        []string     `yaml:"brokers"`
	Topic          string       `yaml:"topic"`
	RawCompression string       `yaml:"compression" default:"none"`
	RawTLS         *RawTLSData  `yaml:"tls"`
	RawSASL        *RawSASLData `yaml:"sasl"`
}

func (*KafkaConfig) GetCompression

func (c *KafkaConfig) GetCompression() (kafka.Compression, error)

func (*KafkaConfig) GetSASL

func (c *KafkaConfig) GetSASL() (sasl.Mechanism, error)

func (*KafkaConfig) GetTLS

func (c *KafkaConfig) GetTLS() (*tls.Config, error)

func (*KafkaConfig) Validate

func (c *KafkaConfig) Validate() error

type RawSASLData

type RawSASLData struct {
	Username  string `yaml:"username"`
	Password  string `yaml:"password"`
	Mechanism string `yaml:"mechanism" default:"plain"`
}

func (*RawSASLData) Build

func (r *RawSASLData) Build() (sasl.Mechanism, error)

func (*RawSASLData) Validate

func (r *RawSASLData) Validate() error

type RawTLSData

type RawTLSData struct {
	CA         string `yaml:"cacert"`
	Cert       string `yaml:"cert"`
	Key        string `yaml:"key"`
	SkipVerify bool   `yaml:"skipVerify"`
}

func (*RawTLSData) Build

func (r *RawTLSData) Build() (*tls.Config, error)

Jump to

Keyboard shortcuts

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