mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-12 19:33:41 +08:00
feat: add ForceEmailTLSVerify configuration and improve email sending error handling
closes #50
This commit is contained in:
3
common/env/helper.go
vendored
3
common/env/helper.go
vendored
@@ -3,13 +3,14 @@ package env
|
||||
import (
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func Bool(env string, defaultValue bool) bool {
|
||||
if env == "" || os.Getenv(env) == "" {
|
||||
return defaultValue
|
||||
}
|
||||
return os.Getenv(env) == "true"
|
||||
return strings.ToLower(os.Getenv(env)) == "true"
|
||||
}
|
||||
|
||||
func Int(env string, defaultValue int) int {
|
||||
|
||||
Reference in New Issue
Block a user