-
Notifications
You must be signed in to change notification settings - Fork 7
/
tree_handler.go
31 lines (25 loc) 路 815 Bytes
/
tree_handler.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//go:build !tinywasm
package gtree
import (
"io"
)
// Output outputs a tree to w with r as Markdown format input.
func Output(w io.Writer, r io.Reader, options ...Option) error {
cfg := newConfig(options)
return initializeTree(cfg).output(w, r, cfg)
}
// Mkdir makes directories.
func Mkdir(r io.Reader, options ...Option) error {
cfg := newConfig(options)
return initializeTree(cfg).mkdir(r, cfg)
}
// Verify verifies directories.
func Verify(r io.Reader, options ...Option) error {
cfg := newConfig(options)
return initializeTree(cfg).verify(r, cfg)
}
// Walk executes user-defined function while traversing tree structure recursively.
func Walk(r io.Reader, callback func(*WalkerNode) error, options ...Option) error {
cfg := newConfig(options)
return initializeTree(cfg).walk(r, callback, cfg)
}