env

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 2 Imported by: ? modules, 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

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