generated from snivilised/arcadia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(proxy): add vfs and implement strategies (#48)
- Loading branch information
1 parent
d208d8a
commit ae51059
Showing
17 changed files
with
154 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,7 @@ | |
"varcheck", | ||
"watchv", | ||
"wgan", | ||
"Wrapf", | ||
"xutils" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,48 @@ | ||
package proxy | ||
|
||
type FileManager struct{} | ||
import ( | ||
"github.com/pkg/errors" | ||
"github.com/snivilised/extendio/xfs/storage" | ||
) | ||
|
||
type FileManager struct { | ||
vfs storage.VirtualFS | ||
finder *PathFinder | ||
} | ||
|
||
func (fm *FileManager) setup(source string) error { | ||
// prepare: move existing file out of the way | ||
|
||
// https://pkg.go.dev/os#Rename LinkError may result | ||
// | ||
// this might not be right. it may be that we want to leave the | ||
// original alone and create other outputs; in this scenario | ||
// we don't want to rename/move the source... | ||
// | ||
destination := fm.finder.Destination(source) | ||
|
||
if err := fm.vfs.Rename(source, destination); err != nil { | ||
return errors.Wrapf(err, "could not complete setup for '%v'", source) | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func (fm *FileManager) move(from, to string) error { | ||
_, _ = from, to | ||
|
||
return nil | ||
} | ||
|
||
func (fm *FileManager) delete(target string) error { | ||
_ = target | ||
|
||
return nil | ||
} | ||
|
||
func (fm *FileManager) tidy() error { | ||
// invoke deletions | ||
// delete journal file | ||
// | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.