sourcefile

package
v0.4.16 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package sourcefile loads configuration from YAML, JSON, or TOML files.

Format is auto-detected from extension (.yaml, .json, .toml).

Example:

source := sourcefile.New("config.yaml", sourcefile.Options{Required: true})
loader := rigging.NewLoader[Config]().WithSource(source)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(path string, opts Options) rigging.Source

New creates a file-based configuration source.

Types

type Options

type Options struct {
	// Format: "yaml", "json", or "toml". Auto-detected from extension if empty.
	Format string

	// Required: if true, missing files cause an error. Default: false (returns empty map).
	Required bool
}

Options configures file source behavior.

Jump to

Keyboard shortcuts

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