loader

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateYAMLFile

func ValidateYAMLFile(path string) bool

ValidateYAMLFile checks if a file has a valid YAML extension

Types

type Loader

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

Loader handles loading declarative configuration from files

func New

func New() *Loader

New creates a new configuration loader

func NewWithPath

func NewWithPath(_ string) *Loader

NewWithPath creates a new configuration loader with a root path (deprecated, for backward compatibility)

func (*Loader) Load

func (l *Loader) Load() (*resources.ResourceSet, error)

Load loads configuration from the default current directory (deprecated)

func (*Loader) LoadFile

func (l *Loader) LoadFile(path string) (*resources.ResourceSet, error)

LoadFile loads configuration from a single YAML file (deprecated, for backward compatibility)

func (*Loader) LoadFromSources

func (l *Loader) LoadFromSources(sources []Source, recursive bool) (*resources.ResourceSet, error)

LoadFromSources loads configuration from multiple sources

type Source

type Source struct {
	Path string
	Type SourceType
}

Source represents a configuration source with its type

func ParseSources

func ParseSources(filenames []string) ([]Source, error)

ParseSources parses the filename flag values into individual sources

type SourceType

type SourceType int

SourceType represents the type of configuration source

const (
	// SourceTypeFile represents a single file source
	SourceTypeFile SourceType = iota
	// SourceTypeDirectory represents a directory source
	SourceTypeDirectory
	// SourceTypeSTDIN represents stdin source
	SourceTypeSTDIN
)

Jump to

Keyboard shortcuts

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