package injector
import "github.com/input-output-hk/catalyst-forge/lib/blueprint/pkg/injector"
Index ¶
- Constants
- type EnvGetter
- type Injector
- func NewDefaultInjector(logger *slog.Logger) Injector
- func NewInjector(logger *slog.Logger, getter EnvGetter) Injector
- func (i *Injector) InjectEnv(v cue.Value, overrides map[string]string) cue.Value
- type OSEnvGetter
Constants ¶
const ( EnvAttrName = "env" EnvNameKey = "name" EnvTypeKey = "type" )
const ( EnvTypeString envType = "string" EnvTypeInt envType = "int" EnvTypeBool envType = "bool" )
Types ¶
type EnvGetter ¶
EnvGetter is an interface to get environment variables
type Injector ¶
type Injector struct {
// contains filtered or unexported fields
}
Injector is a struct that injects environment variables into a CUE value
func NewDefaultInjector ¶
NewDefaultInjector creates a new Injector with default settings and an optional logger.
func NewInjector ¶
NewInjector creates a new Injector
func (*Injector) InjectEnv ¶
InjectEnv injects environment variables into the given CUE value
type OSEnvGetter ¶
type OSEnvGetter struct{}
OSEnvGetter is an implementation of EnvGetter that gets environment variables from the OS
func (OSEnvGetter) Get ¶
func (OSEnvGetter) Get(key string) (string, bool)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
pkg/injector/mocks |
- Version
- v0.0.0-20240928203643-c3373f0052b9 (latest)
- Published
- Sep 28, 2024
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 2 days ago –
Tools for package owners.