config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: Apache-2.0 Imports: 3 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 {
	Inherit   bool             `yaml:"inherit"` // Whether to inherit system environment variables (default: true)
	Providers []ProviderConfig `yaml:"providers"`
}

Config represents the main configuration structure

func Load

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

Load reads and parses the configuration file

func (*Config) GetProvider

func (c *Config) GetProvider(id string) (*ProviderConfig, error)

GetProvider returns a provider configuration by id

type EnvVars

type EnvVars map[string]string

EnvVars represents environment variable overrides

type ProviderConfig

type ProviderConfig struct {
	Kind   string                 `yaml:"kind"`
	ID     string                 `yaml:"id,omitempty"`   // Optional: defaults to 'kind'. Required if multiple providers share the same kind
	Config map[string]interface{} `yaml:"-"`              // Provider-specific configuration (e.g., path, region, endpoint, etc.)
	Keys   map[string]string      `yaml:"keys,omitempty"` // Optional key mappings (source_key: target_key, or "==" to keep same name)
	Env    EnvVars                `yaml:"env,omitempty"`
}

ProviderConfig represents a single provider configuration Each provider loads from a single source. To load multiple secrets from the same provider type, configure multiple provider instances with the same 'kind' but different 'id' values.

func (*ProviderConfig) UnmarshalYAML

func (p *ProviderConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements custom YAML unmarshaling to capture provider-specific fields

Jump to

Keyboard shortcuts

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