package pwalk
import "github.com/opencontainers/selinux/pkg/pwalk"
Index ¶
- func Walk(root string, walkFn WalkFunc) error
- func WalkN(root string, walkFn WalkFunc, num int) error
- type WalkFunc
Functions ¶
func Walk ¶
Walk is a wrapper for filepath.Walk which can call multiple walkFn in parallel, allowing to handle each item concurrently. A maximum of twice the runtime.NumCPU() walkFn will be called at any one time. If you want to change the maximum, use WalkN instead.
The order of calls is non-deterministic.
Note that this implementation only supports primitive error handling:
- no errors are ever passed to walkFn;
- once a walkFn returns any error, all further processing stops and the error is returned to the caller of Walk;
- filepath.SkipDir is not supported;
- if more than one walkFn instance will return an error, only one of such errors will be propagated and returned by Walk, others will be silently discarded.
Deprecated: use github.com/opencontainers/selinux/pkg/pwalkdir.Walk
func WalkN ¶
WalkN is a wrapper for filepath.Walk which can call multiple walkFn in parallel, allowing to handle each item concurrently. A maximum of num walkFn will be called at any one time.
Please see Walk documentation for caveats of using this function.
Deprecated: use github.com/opencontainers/selinux/pkg/pwalkdir.WalkN
Types ¶
type WalkFunc ¶
WalkFunc is the type of the function called by Walk to visit each file or directory. It is an alias for filepath.WalkFunc.
Deprecated: use github.com/opencontainers/selinux/pkg/pwalkdir and [fs.WalkDirFunc].
Source Files ¶
- Version
- v1.12.0 (latest)
- Published
- Mar 20, 2025
- Platform
- js/wasm
- Imports
- 6 packages
- Last checked
- 2 hours ago –
Tools for package owners.