Help us shape the future of Go! Take the 2026 Go Developer Survey

dir

package
v0.19.1253 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(ctx context.Context, fs afero.Fs, obj any, opts *ParseOptions) error

Types

type ErrEmptyFile

type ErrEmptyFile struct {
	Name string
}

func (ErrEmptyFile) Error

func (e ErrEmptyFile) Error() string

type ErrMissingDir

type ErrMissingDir struct {
	Name string
}

func (ErrMissingDir) Error

func (e ErrMissingDir) Error() string

type ErrMissingFile

type ErrMissingFile struct {
	Name string
}

func (ErrMissingFile) Error

func (e ErrMissingFile) Error() string

type ErrParseFile

type ErrParseFile struct {
	Err  error
	Name string
}

func (ErrParseFile) Error

func (e ErrParseFile) Error() string

func (ErrParseFile) Unwrap

func (e ErrParseFile) Unwrap() error

type ParseOptions

type ParseOptions struct {
	Root         string                                 `validate:"required"`
	Ext          string                                 `validate:"required"`
	ParserFn     func(io.ReadCloser, string, any) error `validate:"required"`
	OnParsedFile func(ParsedFile) error

	// SkipDirs are name-tag directories whose files are not read.
	SkipDirs []string

	// IgnoreFileErrors are name-tag directories where a file that fails to
	// decode is left out and the rest of the directory is still loaded.
	IgnoreFileErrors []string
}

type ParsedFile added in v0.19.1170

type ParsedFile struct {
	Path     string
	Group    string
	Contents []byte
	Value    any
}

Jump to

Keyboard shortcuts

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