Last active
February 16, 2022 05:59
-
-
Save JohnStarich/819c39cf5a9def02ccf369e7aeaec0cc to your computer and use it in GitHub Desktop.
HackpadFS article – Base Go interfaces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type FS interface { | |
Open(name string) (File, error) | |
} | |
type File interface { | |
Stat() (FileInfo, error) | |
Read(p []byte) (int, error) | |
Close() error | |
} | |
type FileInfo interface { | |
Name() string | |
Size() int64 | |
Mode() FileMode | |
ModTime() time.Time | |
IsDir() bool | |
Sys() interface{} | |
} | |
type DirEntry interface { | |
Name() string | |
IsDir() bool | |
Type() FileMode | |
Info() (FileInfo, error) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment