Documentation
¶
Index ¶
- func LoadConfig(path string, target interface{}) error
- func LoadConfigWithOptions(path string, target interface{}, options ProcessorOptions) error
- func ProcessYAMLString(yamlStr string, target interface{}) error
- type Processor
- func (p *Processor) LoadAndDecode(path string, target interface{}) error
- func (p *Processor) LoadFile(path string) (*yaml.Node, error)
- func (p *Processor) ProcessAndDecode(rawYAML []byte, target interface{}) error
- func (p *Processor) ProcessBytes(rawYAML []byte) (*yaml.Node, error)
- func (p *Processor) ProcessString(yamlStr string) (*yaml.Node, error)
- type ProcessorOptions
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
LoadConfig is a convenience function that loads and processes a config file
func LoadConfigWithOptions ¶
func LoadConfigWithOptions(path string, target interface{}, options ProcessorOptions) error
LoadConfigWithOptions loads a config file with custom processor options
func ProcessYAMLString ¶
ProcessYAMLString processes a YAML string with default options
Types ¶
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor handles YAML processing with environment variable expansion and custom tags
func NewDefaultProcessor ¶
func NewDefaultProcessor() *Processor
NewDefaultProcessor creates a processor with default options
func NewProcessor ¶
func NewProcessor(options ProcessorOptions) *Processor
NewProcessor creates a new YAML processor with the given options
func (*Processor) LoadAndDecode ¶
LoadAndDecode loads a YAML file, processes it, and decodes into the target struct
func (*Processor) ProcessAndDecode ¶
ProcessAndDecode processes YAML bytes and decodes into the target struct
func (*Processor) ProcessBytes ¶
ProcessBytes processes raw YAML bytes and returns the processed node
type ProcessorOptions ¶
type ProcessorOptions struct {
EnableEnvVarExpansion bool
EnableFileTag bool
BaseDir string
RequireEnvVars bool
}
ProcessorOptions configures the YAML processor behavior
func DefaultOptions ¶
func DefaultOptions() ProcessorOptions
DefaultOptions returns default processor options with all features enabled
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher watches a directory tree for file changes and calls onReload() debounced.
func NewWatcher ¶
func NewWatcher(watchDir string, reloadDelay time.Duration, extensions []string, onReload func() error) *Watcher
NewWatcher constructs a watcher. Call w.Setup() to start. extensions: list of file extensions to watch (e.g., []string{".yaml", ".yml", ".crt", ".key", ".pem"}) If extensions is empty or nil, all files will be watched.