implemented os file interface acstraction
This commit is contained in:
parent
23528fe28e
commit
ad41ddbe54
11 changed files with 223 additions and 92 deletions
|
|
@ -8,6 +8,7 @@ import (
|
|||
"os"
|
||||
|
||||
"cachefs/pkg/fs"
|
||||
"cachefs/pkg/provider/parse"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -18,11 +19,16 @@ var (
|
|||
)
|
||||
|
||||
func main() {
|
||||
flag.StringVar(&dst, "dst", "", "local directory to cache files")
|
||||
flag.StringVar(&dst, "dst", "", "url path to cache files (example: file:///mnt/cache)")
|
||||
flag.StringVar(&metadata, "data", "", "path to metadata file")
|
||||
flag.Parse()
|
||||
|
||||
err := fs.MetadataGenerator(metadata, dst)
|
||||
dstfs, err := parse.FS(dst)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
err = fs.MetadataGenerator(metadata, dstfs)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue