env

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KafkaBrokersEnvKey holds env key, which has value for Kafka brokers
	KafkaBrokersEnvKey = "KAFKA_BROKERS"
	// MaxKafkaTopicsPartitionsEnvKey holds env key, which has value for
	// Kafka topic max partitions
	MaxKafkaTopicsPartitionsEnvKey = "KAFKA_TOPIC_MAX_PARTITIONS"
	// DefaultMaxParts is default for Max kafka topic partitions
	DefaultMaxParts = 3
	// SchemaRegistryURLEnvKey holds env key, which has value for Schema registry URL
	SchemaRegistryURLEnvKey = "SCHEMA_REGISTRY_URL"
	// MaxConcurrentReconcilesEnvKey holds env key, which has value for Maximum parallel reconciliations done
	MaxConcurrentReconcilesEnvKey  = "MAX_CONCURRENT_RECONCILES"
	DefaultMaxConcurrentReconciles = 2
	// LabelSelectorEnvKey will have label selector, which will make us work only with objects, which have those labels added. If not defined, we will work with ALL objects in K8S cluster.
	LabelSelectorEnvKey = "LABEL_SELECTOR"
	// SlackWebhookURLEnvKey holds env key, which has value for Slack webhook URL
	SlackTokenEnvKey   = "SLACK_TOKEN"
	SlackChannelEnvKey = "SLACK_CHANNEL"
)

Variables

This section is empty.

Functions

func GetEnv

func GetEnv[T Value](name string) (T, error)

GetEnv would get Env variable

Types

type Config

type Config struct {
	KafkaBrokers             string
	MaxKafkaTopicsPartitions uint
	SchemaRegistryURL        string
	MaxConcurrentReconciles  int
	LabelSelectors           *metav1.LabelSelector
	SlackToken               string
	SlackChannel             string
}

func NewConfig

func NewConfig() (*Config, error)

type Value

type Value interface {
	string | int | bool
}

generic constraint interface

Jump to

Keyboard shortcuts

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