iwalkdeep

package module
v0.0.0-...-439f66e Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

README

iwalkdeep

-- import "github.com/oderwat/iwalkdeep"

The package "ideepwalk" helps to iterates over all directories in a give path in bottom to top order. This is helpfull in many use cases where you for example want to clean up empty directories after processing/moving files in the hierarchie.

As speciality the packaged exposes this functionality also as an easy to use iterator like in the following example

for dir := range IWalkDeep("/homes") {
  fmt.print(dir)
}

Usage

func IWalkDeep
func IWalkDeep(root string) <-chan string

This is the "Iterator" which can eaasily be used for dir := range IWalkDeep(path) {}

func WalkDeep
func WalkDeep(root string, fun WalkDeepFunc)

Walk all directories in root from bottom to top calling WalkDeepFunc for every encountered directory

type WalkDeepFunc
type WalkDeepFunc func(dir string)

This function is called by WalkDeep for each directory on its way up to the root of the given path

(made with godocdown)

Documentation

Overview

Package iwalkdeep is an iterator for the filesystem

It helps to iterates over all directories in a give path in bottom to top order. This is helpfull in many use cases where you for example want to clean up empty directories after processing/moving files in the hierarchie.

As speciality the packaged exposes this functionality also as an easy to use iterator like in the following example:

for dir := range IWalkDeep("/homes") {
  fmt.print(dir)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IWalkDeep

func IWalkDeep(root string) <-chan string

IWalkDeep is the "Iterator" which can eaasily be used for dir := range IWalkDeep(path) {}

func WalkDeep

func WalkDeep(root string, fun WalkDeepFunc)

WalkDeep walkes all directories in root from bottom to top calling WalkDeepFunc for every encountered directory

Types

type WalkDeepFunc

type WalkDeepFunc func(dir string)

WalkDeepFunc is called by WalkDeep for each directory on its way up to the root of the given path

Jump to

Keyboard shortcuts

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