Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type InfoT ¶
T, Parent, and Leaf are aliases to improve readability of fixture definitions. InfoT augments T with its FileInfo for tests that want to check mode, size, etc.
type Leaf ¶
type Leaf = []byte
T, Parent, and Leaf are aliases to improve readability of fixture definitions. InfoT augments T with its FileInfo for tests that want to check mode, size, etc.
type Parent ¶
T, Parent, and Leaf are aliases to improve readability of fixture definitions. InfoT augments T with its FileInfo for tests that want to check mode, size, etc.
type T ¶
type T = interface{}
T, Parent, and Leaf are aliases to improve readability of fixture definitions. InfoT augments T with its FileInfo for tests that want to check mode, size, etc.
type Walker ¶
type Walker struct { IgnoredNames map[string]struct{} // Info makes WalkContents return InfoT recursively. See that function. Info bool }
Walker is a collection of settings. TODO: Add (Walker).Walk* variant that inspects FileInfo, too, not just content.
func (Walker) WalkContents ¶
WalkContents traverses all of node and returns map and []byte objects representing parents/directories and leaves/files, respectively.
For example, if node is a Parent with children named a and b that are regular files, and an empty subdirectory subdir, returns:
Parent{ "a": Leaf("a's content"), "b": Leaf("b's content"), "subdir": Parent{}, }
If w.Info, the returned contents will include fsnode.FileInfo, for example:
InfoT{ fsnode.NewDirInfo("parent"), Parent{ "a": InfoT{ fsnode.NewRegInfo("a").WithSize(11), Leaf("a's content"), }, "b": InfoT{ fsnode.NewRegInfo("b").WithModePerm(0755), Leaf("b's content"), }, "subdir": InfoT{ fsnode.NewDirInfo("subdir") Parent{}, }, }, }