loaders

package
v0.0.1-dev.fred-3 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultLoader = NewSubLoader(NewYAMLLoader())

Generic loader that can load values of any supported format

Functions

This section is empty.

Types

type Loader

type Loader interface {
	// Returns true if the byte array can be converted into a key/value map
	CanGetEnvironmentValues([]byte) bool
	// Converts the byte array into a key/value map
	GetEnvironmentValues([]byte) (map[string]string, error)
	// Human-readable name of the loader
	Name() string
}

Defines a type that can load environment values from raw byte sources

type SOPSYAMLSubloader

type SOPSYAMLSubloader struct{}

func (*SOPSYAMLSubloader) CanGetEnvironmentValues

func (*SOPSYAMLSubloader) CanGetEnvironmentValues(yamlBytes []byte) bool

func (*SOPSYAMLSubloader) GetEnvironmentValues

func (*SOPSYAMLSubloader) GetEnvironmentValues(yamlBytes []byte) (map[string]string, error)

func (*SOPSYAMLSubloader) Name

func (*SOPSYAMLSubloader) Name() string

type SubLoader

type SubLoader struct {
	SubLoaders []Loader
}

Loader that tries several other loaders and uses the first one that can successfully load provided values

func NewSubLoader

func NewSubLoader(loaders ...Loader) *SubLoader

func (*SubLoader) CanGetEnvironmentValues

func (sl *SubLoader) CanGetEnvironmentValues(bytes []byte) bool

func (*SubLoader) GetEnvironmentValues

func (sl *SubLoader) GetEnvironmentValues(bytes []byte) (map[string]string, error)

type YAMLLoader

type YAMLLoader struct {
	*SubLoader
}

func NewYAMLLoader

func NewYAMLLoader() *YAMLLoader

func (*YAMLLoader) Name

func (*YAMLLoader) Name() string

Jump to

Keyboard shortcuts

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