traverse

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package traverse provides utilities to traverse directories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Traverse

func Traverse(bfs billy.Filesystem, base string, fun FuncTraverse) error

Traverse traverses the given directory and calls the given function with each file.

func Walk

func Walk(bfs billy.Filesystem, root string, walkFn filepath.WalkFunc) error

Walk walks the file tree rooted at root, calling fn for each file or directory in the tree, including root. All errors that arise visiting files and directories are filtered by fn: see the WalkFunc documentation for details.

The files are walked in lexical order, which makes the output deterministic but requires Walk to read an entire directory into memory before proceeding to walk that directory. Walk does not follow symbolic links.

Function adapted from https://github.com/golang/go/blob/3b770f2ccb1fa6fecc22ea822a19447b10b70c5c/src/path/filepath/path.go#L500

func YamlDockerfiles

func YamlDockerfiles(bfs billy.Filesystem, base string, fun GhwFunc) error

YamlDockerfiles traverses all yaml/yml in the given directory and calls the given function with each workflow.

Types

type FuncTraverse

type FuncTraverse func(path string, info fs.FileInfo) error

FuncTraverse is a function that gets called with each file in a directory.

type GhwFunc

type GhwFunc func(path string) error

GhwFunc is a function that gets called with each file in a GitHub Actions workflow directory. It receives the path to the file.

Jump to

Keyboard shortcuts

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