-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterface.go
70 lines (49 loc) · 1.16 KB
/
interface.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package pathutil
import (
"io"
"os"
"github.com/JaSei/hashutil-go"
)
type VisitFunc func(path Path)
type VisitOpt struct {
Recurse bool
}
type LinesFunc func(string)
type Path interface {
String() string
Canonpath() string
Basename() string
Chdir() (Path, error)
Rename(string) (Path, error)
Stat() (os.FileInfo, error)
IsDir() bool
Exists() bool
IsFile() bool
IsRegularFile() bool
Remove() error
RemoveTree() error
Visit(VisitFunc, VisitOpt)
CopyFile(string) (Path, error)
CopyFrom(io.Reader) (int64, error)
CryptoMd5() (hashutil.Md5, error)
CryptoSha1() (hashutil.Sha1, error)
CryptoSha256() (hashutil.Sha256, error)
CryptoSha384() (hashutil.Sha384, error)
CryptoSha512() (hashutil.Sha512, error)
MakePath() error
MakePathMode(os.FileMode) error
OpenReader() (ReadSeekCloser, error)
OpenWriter() (*os.File, error)
OpenWriterAppend() (*os.File, error)
Slurp() (string, error)
SlurpBytes() ([]byte, error)
Spew(string) error
SpewBytes([]byte) error
Lines() ([]string, error)
LinesWalker(LinesFunc) error
Child(...string) (Path, error)
Children() ([]Path, error)
Parent() Path
Append(string) error
AppendBytes([]byte) error
}