-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create when db file does not exists * fix UpdateMetadata (#58) * CreateModel * fix spelling * fix tests * extract fs funcs * manifest & model etag
- Loading branch information
Showing
7 changed files
with
157 additions
and
20 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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package fs | ||
|
||
import ( | ||
"os" | ||
) | ||
|
||
func FileExists(path string) bool { | ||
fsInfo, err := os.Stat(path) | ||
if err == nil && !fsInfo.IsDir() { | ||
return true | ||
} | ||
return false | ||
} | ||
|
||
func DirExists(path string) bool { | ||
fsInfo, err := os.Stat(path) | ||
if err == nil && fsInfo.IsDir() { | ||
return true | ||
} | ||
return false | ||
} | ||
|
||
func EnsureDirPath(path string) error { | ||
if !DirExists(path) { | ||
return os.MkdirAll(path, 0700) | ||
} | ||
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