From decc2fbf5db4a05aec93462ad35d890930bddd04 Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Sat, 28 May 2022 11:12:00 -0700 Subject: Implement Make Alias transaction --- hotline/file_store.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'hotline/file_store.go') 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) +} -- cgit