diff options
| author | ludwigxia <chalet3@yeah.net> | 2025-01-22 16:48:55 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-22 00:48:55 -0800 |
| commit | 5452405a810f3590848aba3acb3f4809f7623ddf (patch) | |
| tree | dc88753f08cd47c9347fa82eab5801b90d47edb8 /weed/util/parse.go | |
| parent | ca4dca14d8b92bc193477f1b97d95fb440f21b43 (diff) | |
| download | seaweedfs-5452405a810f3590848aba3acb3f4809f7623ddf.tar.xz seaweedfs-5452405a810f3590848aba3acb3f4809f7623ddf.zip | |
cloud tier: support for Alibaba Cloud OSS (#6466)
Diffstat (limited to 'weed/util/parse.go')
| -rw-r--r-- | weed/util/parse.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/weed/util/parse.go b/weed/util/parse.go index 502f3a80f..180e8e61e 100644 --- a/weed/util/parse.go +++ b/weed/util/parse.go @@ -28,6 +28,18 @@ func ParseUint64(text string, defaultValue uint64) uint64 { return count } +func ParseBool(s string, defaultValue bool) bool { + value, err := strconv.ParseBool(s) + if err != nil { + return defaultValue + } + return value +} + +func BoolToString(b bool) string { + return strconv.FormatBool(b) +} + func ParseFilerUrl(entryPath string) (filerServer string, filerPort int64, path string, err error) { if !strings.HasPrefix(entryPath, "http://") && !strings.HasPrefix(entryPath, "https://") { entryPath = "http://" + entryPath |
