Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReadFileWalker ¶
type ReadFileWalker interface { ReadFile(string) ([]byte, error) Walk(string, filepath.WalkFunc) error }
ReadFileWalker is used to walk a file tree and read the contents of each file This is used for mocking. `afero.Afero` fulfills this interface. `filepath.Walk` and `ioutil.ReadFile` are functions in the core packages that fit these signatures.
type ResourceDir ¶
type ResourceDir struct { // Base is the base (root) dir that will be walked. It is expected to be an absolute path, // i.e. have a root to the path, at the very least "/". Base string Walker ReadFileWalker // contains filtered or unexported fields }
ResourceDir contains the the directory to walk on and the WalkFuncs to perform
func (*ResourceDir) AddStep ¶
func (rd *ResourceDir) AddStep(pattern string, step Step)
AddStep adds a Step to the Walker Each Step will be given the bytes and filepath of resource files matching the supplied name pattern
func (*ResourceDir) Walk ¶
func (rd *ResourceDir) Walk() error
Walk applies all of the Step functions against the Base directory
type ResourceWalker ¶
ResourceWalker builds a Step list with the intent to Walk them
Click to show internal directories.
Click to hide internal directories.