]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/file_store.go
Refactor and cleanup
[rbdr/mobius] / hotline / file_store.go
index f528c3677ee08f65a4c1f8ca52ac3b88dff49b48..e9d083f6b0a8af29354d224c6f8557fc427c22f2 100644 (file)
@@ -12,7 +12,7 @@ type FileStore interface {
        Stat(name string) (os.FileInfo, error)
        Open(name string) (*os.File, error)
        Symlink(oldname, newname string) error
-
+       Remove(name string) error
        // TODO: implement these
        // Rename(oldpath string, newpath string) error
        // RemoveAll(path string) error
@@ -36,6 +36,10 @@ func (fs *OSFileStore) Symlink(oldname, newname string) error {
        return os.Symlink(oldname, newname)
 }
 
+func (fs *OSFileStore) Remove(name string) error {
+       return os.Remove(name)
+}
+
 type MockFileStore struct {
        mock.Mock
 }
@@ -63,3 +67,8 @@ func (mfs *MockFileStore) Symlink(oldname, newname string) error {
        args := mfs.Called(oldname, newname)
        return args.Error(0)
 }
+
+func (mfs *MockFileStore) Remove(name string) error {
+       args := mfs.Called(name)
+       return args.Error(0)
+}