diff options
Diffstat (limited to 'vendor/go4.org/wkfs')
-rw-r--r-- | vendor/go4.org/wkfs/gcs/gcs.go | 8 | ||||
-rw-r--r-- | vendor/go4.org/wkfs/wkfs.go | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/vendor/go4.org/wkfs/gcs/gcs.go b/vendor/go4.org/wkfs/gcs/gcs.go index a970c75..d768824 100644 --- a/vendor/go4.org/wkfs/gcs/gcs.go +++ b/vendor/go4.org/wkfs/gcs/gcs.go @@ -165,6 +165,14 @@ func (fs *gcsFS) OpenFile(name string, flag int, perm os.FileMode) (wkfs.FileWri return fs.sc.Bucket(bucket).Object(fileName).NewWriter(fs.ctx), nil } +func (fs *gcsFS) Remove(name string) error { + bucket, fileName, err := fs.parseName(name) + if err != nil { + return err + } + return fs.sc.Bucket(bucket).Object(fileName).Delete(fs.ctx) +} + type statInfo struct { name string size int64 diff --git a/vendor/go4.org/wkfs/wkfs.go b/vendor/go4.org/wkfs/wkfs.go index f4df062..08c8786 100644 --- a/vendor/go4.org/wkfs/wkfs.go +++ b/vendor/go4.org/wkfs/wkfs.go @@ -55,6 +55,7 @@ func MkdirAll(path string, perm os.FileMode) error { return fs(path).MkdirAll(pa func OpenFile(name string, flag int, perm os.FileMode) (FileWriter, error) { return fs(name).OpenFile(name, flag, perm) } +func Remove(name string) error { return fs(name).Remove(name) } func Create(name string) (FileWriter, error) { // like os.Create but WRONLY instead of RDWR because we don't // expose a Reader here. @@ -79,6 +80,7 @@ func (osFS) MkdirAll(path string, perm os.FileMode) error { return os.MkdirAll(p func (osFS) OpenFile(name string, flag int, perm os.FileMode) (FileWriter, error) { return os.OpenFile(name, flag, perm) } +func (osFS) Remove(name string) error { return os.Remove(name) } type FileSystem interface { Open(name string) (File, error) @@ -86,6 +88,7 @@ type FileSystem interface { Stat(name string) (os.FileInfo, error) Lstat(name string) (os.FileInfo, error) MkdirAll(path string, perm os.FileMode) error + Remove(name string) error } // well-known filesystems |