env

package
v0.1.33 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package env allows propagating runtime configurations via the environment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	*adapter.EnvConfig
	// Environment variable containing the namespace of the adapter.
	Namespace string `envconfig:"NAMESPACE" required:"true"`
	// Component is the kind of this adapter.
	Component string `envconfig:"K_COMPONENT" required:"true"`
}

Config is the minimal set of configuration parameters source adapters should support.

func (*Config) GetComponent

func (c *Config) GetComponent() string

GetComponent implements ConfigAccessor.

type ConfigAccessor

type ConfigAccessor interface {
	adapter.EnvConfigAccessor
	// Get the component name.
	GetComponent() string
}

ConfigAccessor is a superset of adaper.EnvConfigAccessor that overrides properties about certain variables.

func MustProcessConfig

func MustProcessConfig(envCtor ConfigConstructor) ConfigAccessor

MustProcessConfig populates the specified adapter.EnvConfigConstructor based on environment variables.

type ConfigConstructor

type ConfigConstructor func() ConfigAccessor

ConfigConstructor is a callback function that returns a ConfigAccessor.

Jump to

Keyboard shortcuts

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