source

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvSource

type EnvSource struct{}

EnvSource reads from environment variables

func NewEnvSource

func NewEnvSource() *EnvSource

NewEnvSource creates a new environment variable source

func (*EnvSource) Get

func (e *EnvSource) Get(key string) (string, bool)

Get retrieves an environment variable

type MapSource

type MapSource struct {
	// contains filtered or unexported fields
}

MapSource is a map-based source (useful for testing or file-based configs)

func NewMapSource

func NewMapSource(data map[string]string) *MapSource

NewMapSource creates a new map source

func (*MapSource) Get

func (m *MapSource) Get(key string) (string, bool)

Get retrieves a value from the map

func (*MapSource) Set

func (m *MapSource) Set(key, value string)

Set sets a value in the map

type MultiSource

type MultiSource struct {
	// contains filtered or unexported fields
}

MultiSource combines multiple sources, checking them in order

func NewMultiSource

func NewMultiSource(sources ...Source) *MultiSource

NewMultiSource creates a new multi-source

func (*MultiSource) Get

func (m *MultiSource) Get(key string) (string, bool)

Get retrieves a value from the first source that has it

type Source

type Source interface {
	Get(key string) (string, bool)
}

Source is an interface for configuration sources

Jump to

Keyboard shortcuts

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