directory

package module
v0.0.0-...-9c0a803 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

README

directory

This is a simple Go package, that contains functions to work with/parse directory structures.

Main components of this package:

  • Go package to concurrently or linearly recursively walk directory structure and perform given actions on files and directories.
  • ado - CLI tool that extracts ados (TODOs, NOTEs etc) (see ado)
  • structure - CLI tool that prints the structure of the current working directory (see structure).

TODO

  • Improve this readme

Author

Written by Meelis Utt

Documentation

Overview

Package `directory` simple functions to parse and work with directory structure.

Index

Constants

This section is empty.

Variables

Ignore is a variable to hold regexp expression of directories and files to ignore.

View Source
var WaitGroup sync.WaitGroup

WaitGroup is a variable to easily handle goroutine waiting.

Functions

func SetIgnore

func SetIgnore(ignFilePath string)

SetIgnore sets global Ignore with the contents of ignore file, where each line represents one file or directory to ignore.

func Walk

func Walk(root string, fileAction func(string), dirAction func(string), depth int)

Walk is a concurrent function that walks recursively given directory structure, performing given actions on files and directories. Actions on files and directories are expected to take the corresponding file/dir path as an argument and not return anything. Directories and files can also be ignored by setting Ignore value with SetIgnore function or setting it manually. Depth of directory structure can be controlled with variables depth (and level).

func WalkLinear

func WalkLinear(root string, fileAction func(string), dirAction func(string), depth int, level int)

WalkLinear walks recursively given directory structure, performing given actions on files and directories. Actions on files and directories are expected to take the corresponding file/dir path as an argument and not return anything. Directories and files can also be ignored by setting Ignore value with SetIgnore function or setting it manually. Depth of directory structure can be controlled with variables depth (and level).

Types

This section is empty.

Directories

Path Synopsis
Extract ados recursively from given/current directory.
Extract ados recursively from given/current directory.
Print directory tree structure
Print directory tree structure

Jump to

Keyboard shortcuts

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