aboutsummaryrefslogtreecommitdiff
path: root/hotline/file_store.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2022-05-28 11:12:00 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2022-05-28 11:12:00 -0700
commitdecc2fbf5db4a05aec93462ad35d890930bddd04 (patch)
tree28b15b1cb67eb298657c918faf1a3324bf6da424 /hotline/file_store.go
parent7f12122f861fab4f4d0e3972ca0e66ff8becae19 (diff)
Implement Make Alias transaction
Diffstat (limited to 'hotline/file_store.go')
-rw-r--r--hotline/file_store.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/hotline/file_store.go b/hotline/file_store.go
index b56d9a1..c1c3929 100644
--- a/hotline/file_store.go
+++ b/hotline/file_store.go
@@ -11,6 +11,8 @@ type FileStore interface {
Mkdir(name string, perm os.FileMode) error
Stat(name string) (os.FileInfo, error)
Open(name string) (*os.File, error)
+ Symlink(oldname, newname string) error
+
// TODO: implement these
//Rename(oldpath string, newpath string) error
//RemoveAll(path string) error
@@ -30,6 +32,10 @@ func (fs OSFileStore) Open(name string) (*os.File, error) {
return os.Open(name)
}
+func (fs OSFileStore) Symlink(oldname, newname string) error {
+ return os.Symlink(oldname, newname)
+}
+
type MockFileStore struct {
mock.Mock
}
@@ -52,3 +58,8 @@ func (mfs MockFileStore) Open(name string) (*os.File, error) {
args := mfs.Called(name)
return args.Get(0).(*os.File), args.Error(1)
}
+
+func (mfs MockFileStore) Symlink(oldname, newname string) error {
+ args := mfs.Called(oldname, newname)
+ return args.Error(0)
+}