diff options
author | Sergio Arbeo <serabe@gmail.com> | 2016-12-19 10:42:14 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-12-19 10:42:14 +0100 |
commit | 1eb39394cdf09b26eb2f5c98225fb2912980e61f (patch) | |
tree | 25e7b370498733aba66688c5d53c29fcef6aa21c /utils/fs/fs.go | |
parent | c9353b2bd7c1cbdf8f78dad6deac64ed2f2ed9eb (diff) | |
download | go-git-1eb39394cdf09b26eb2f5c98225fb2912980e61f.tar.gz |
Extract billy (#173)
* Extract billy
Billy is a new library directly extracted from go-git. It abstract
several storages systems in a filesystem interface.
More in github.com/src-d/billy
* Fix grouping in imports block
* Update billy to v1
* Re-remove fs_implementation example
Diffstat (limited to 'utils/fs/fs.go')
-rw-r--r-- | utils/fs/fs.go | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/utils/fs/fs.go b/utils/fs/fs.go deleted file mode 100644 index 7e6c01f..0000000 --- a/utils/fs/fs.go +++ /dev/null @@ -1,52 +0,0 @@ -// Package fs interace and implementations used by storage/filesystem -package fs - -import ( - "errors" - "io" - "os" -) - -var ( - ErrClosed = errors.New("file: Writing on closed file.") - ErrReadOnly = errors.New("this is a read-only filesystem") - ErrNotSupported = errors.New("feature not supported") -) - -type Filesystem interface { - Create(filename string) (File, error) - Open(filename string) (File, error) - OpenFile(filename string, flag int, perm os.FileMode) (File, error) - Stat(filename string) (FileInfo, error) - ReadDir(path string) ([]FileInfo, error) - TempFile(dir, prefix string) (File, error) - Rename(from, to string) error - Remove(filename string) error - Join(elem ...string) string - Dir(path string) Filesystem - Base() string -} - -type File interface { - Filename() string - IsClosed() bool - io.Writer - io.Reader - io.Seeker - io.Closer -} - -type FileInfo os.FileInfo - -type BaseFile struct { - BaseFilename string - Closed bool -} - -func (f *BaseFile) Filename() string { - return f.BaseFilename -} - -func (f *BaseFile) IsClosed() bool { - return f.Closed -} |