package pwalk

import "github.com/opencontainers/selinux/pkg/pwalk"

Index

Functions

func Walk

func Walk(root string, walkFn WalkFunc) error

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

* filepath.SkipDir is not supported;

func WalkN

func WalkN(root string, walkFn WalkFunc, num int) error

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.

Types

type WalkFunc

type WalkFunc = filepath.WalkFunc

Source Files

pwalk.go

Version
v1.4.0
Published
Mar 11, 2020
Platform
js/wasm
Imports
5 packages
Last checked
2 hours ago

Tools for package owners.