release: v0.1.3

This commit is contained in:
2026-04-03 14:24:29 +08:00
parent 98839e9782
commit 83ee4bb5ea
14 changed files with 413 additions and 132 deletions

View File

@@ -3,6 +3,7 @@ package conf
import (
"os"
"strings"
"sync/atomic"
)
// 构建信息
@@ -17,23 +18,30 @@ var (
DebugProxy string = ""
DebugSkipSSLVerify bool = false
runtimeDebugEnabled atomic.Bool
)
func init() {
if !IsDebugMode() {
return
}
if proxy := os.Getenv("CKWK_DEBUG_PROXY"); proxy != "" {
DebugProxy = proxy
}
DebugSkipSSLVerify = parseEnvBool("CKWK_DEBUG_SKIP_SSL_VERIFY")
runtimeDebugEnabled.Store(parseEnvBool("CKWK_DEBUG_ENABLED"))
}
func IsDebugMode() bool {
func IsBuildDebugMode() bool {
return !strings.EqualFold(Mode, "release")
}
func IsRuntimeDebugEnabled() bool {
return runtimeDebugEnabled.Load()
}
func SetRuntimeDebugEnabled(enabled bool) {
runtimeDebugEnabled.Store(enabled)
}
func parseEnvBool(key string) bool {
value := strings.TrimSpace(os.Getenv(key))
switch strings.ToLower(value) {