1package fsutil
2
3import (
4	"hash"
5	"os"
6
7	"golang.org/x/net/context"
8)
9
10type walkerFn func(ctx context.Context, pathC chan<- *currentPath) error
11
12func Changes(ctx context.Context, a, b walkerFn, changeFn ChangeFunc) error {
13	return nil
14}
15
16type HandleChangeFn func(ChangeKind, string, os.FileInfo, error) error
17
18type ContentHasher func(*Stat) (hash.Hash, error)
19
20func GetWalkerFn(root string) walkerFn {
21	return func(ctx context.Context, pathC chan<- *currentPath) error {
22		return Walk(ctx, root, nil, func(path string, f os.FileInfo, err error) error {
23			if err != nil {
24				return err
25			}
26
27			p := &currentPath{
28				path: path,
29				f:    f,
30			}
31
32			select {
33			case <-ctx.Done():
34				return ctx.Err()
35			case pathC <- p:
36				return nil
37			}
38		})
39	}
40}
41
42func emptyWalker(ctx context.Context, pathC chan<- *currentPath) error {
43	return nil
44}
45