fs

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: BSD-2-Clause Imports: 3 Imported by: 0 modules, 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

Overview

Package fs provides predicates over io/fs.FileInfo, derived from the FileInfo interface methods.

Index

Constants

This section is empty.

Variables

View Source
var (
	// IsDirInfo is a Predicate[iofs.FileInfo] that is true when the
	// FileInfo reports a directory. Compose it with P.ContraMap and
	// any extractor to lift it onto a state type.
	IsDirInfo = func(fi iofs.FileInfo) bool { return fi.IsDir() }

	// IsRegularInfo is a Predicate[iofs.FileInfo] that is true when
	// the FileInfo reports a regular file. Compose it with P.ContraMap
	// and any extractor to lift it onto a state type.
	IsRegularInfo = func(fi iofs.FileInfo) bool { return fi.Mode().IsRegular() }
)

Functions

func IsDir

func IsDir[S any](get func(S) iofs.FileInfo) P.Predicate[S]

IsDir returns a Predicate[S] that is true when the FileInfo extracted from a value of type S reports a directory. The extractor must return a non-nil FileInfo; pass a lens getter for callers that own a lens.

func IsRegular

func IsRegular[S any](get func(S) iofs.FileInfo) P.Predicate[S]

IsRegular returns a Predicate[S] that is true when the FileInfo extracted from a value of type S reports a regular file. The extractor must return a non-nil FileInfo; pass a lens getter for callers that own a lens.

Types

This section is empty.

Jump to

Keyboard shortcuts

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