From 57224ffa79aac59155a0f6a4ad47f224cac736fd Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Fri, 13 Jan 2017 00:06:46 +0000 Subject: Use wkfs to manage the lets encrypt cache --- vendor/go4.org/wkfs/gcs/gcs.go | 8 ++++++++ vendor/go4.org/wkfs/wkfs.go | 3 +++ 2 files changed, 11 insertions(+) (limited to 'vendor/go4.org/wkfs') 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 -- cgit v1.2.3