dir

package
v0.19.1300 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: AGPL-3.0 Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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