dirdata

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirData

type DirData struct {
	Entries []DirEntry
}

DirData holds pre-read YAML file contents from a set of directories. This allows multiple resource loaders to parse from the same file data without each independently opening and reading files from disk, which avoids file handle contention on Windows.

func ReadDirs

func ReadDirs(dirs []string) (*DirData, error)

ReadDirs reads all YAML files from the given directories into memory.

type DirDataLoader

type DirDataLoader[T meta.Resource] interface {
	LoadFromDirData(data *DirData) ([]T, error)
}

DirDataLoader can load resources from pre-read directory data, avoiding repeated file system reads when multiple resource types need to be loaded from the same directories.

type DirEntry

type DirEntry struct {
	Dir   string
	Files []FileEntry
}

DirEntry holds the YAML files from a single directory.

type FileEntry

type FileEntry struct {
	Name    string
	Content []byte
}

FileEntry holds the name and content of a single YAML file.

Jump to

Keyboard shortcuts

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