filesys

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Exports = map[string]any{
	"Recursive": Recursive,

	"onReady":    withYaklangOnStart,
	"onStat":     withYaklangStat,
	"onFileStat": withYaklangFileStat,
	"onDirStat":  withYaklangDirStat,
	"dir":        WithDir,
}

Functions

func Recursive

func Recursive(raw string, opts ...Option) error

Recursive recursively walk through the file system raw: the root path opts: options return: error

Example: ``` err := filesys.Recursive( //

"testdata",
filesys.dir(["cc", "dd"], filesys.onFileStat((name, info) => {})),

) ```

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() *Config

type Option

type Option func(*Config)

func WithDir

func WithDir(i any, opts ...Option) Option

func WithDirMatch

func WithDirMatch(globDir string, opts ...Option) Option

func WithDirMatches

func WithDirMatches(raw any, opts ...Option) Option

func WithDirStat

func WithDirStat(f func(pathname string, info os.FileInfo) error) Option

func WithEmbedFS

func WithEmbedFS(f embed.FS) Option

func WithFileStat

func WithFileStat(f func(pathname string, info os.FileInfo) error) Option

func WithFileSystem

func WithFileSystem(f fs.FileSystem) Option

func WithOnStart

func WithOnStart(f func(basename string, isDir bool) error) Option

func WithStat

func WithStat(f func(isDir bool, pathname string, info os.FileInfo) error) Option

Jump to

Keyboard shortcuts

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