Logo
Explore Help
Register Sign In
kato/WarpBox
1
0
Fork 0
You've already forked WarpBox
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
master
WarpBox/lib/helpers/env.go

21 lines
288 B
Go
Raw Permalink Normal View History

refactor(server): use boxstore helpers and file status consts - Move box ID validation, file listing/pathing, manifest creation, and uploads to `boxstore` - Use shared helpers for safe filenames and polling interval env parsing - Add file status constants to `models` to avoid duplicated magic strings across handlersrefactor(server): use boxstore helpers and file status consts - Move box ID validation, file listing/pathing, manifest creation, and uploads to `boxstore` - Use shared helpers for safe filenames and polling interval env parsing - Add file status constants to `models` to avoid duplicated magic strings across handlers
2026-04-27 18:01:02 +03:00
package helpers
import (
"os"
"strconv"
)
func EnvInt(name string, fallback int, minimum int) int {
rawValue := os.Getenv(name)
if rawValue == "" {
return fallback
}
value, err := strconv.Atoi(rawValue)
if err != nil || value < minimum {
return fallback
}
return value
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.4 Page: 61ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API