mirror of
https://github.com/JustKato/FreePad.git
synced 2026-02-23 15:50:46 +02:00
* Basics realized
This commit is contained in:
33
lib/helper/helper_main.go
Normal file
33
lib/helper/helper_main.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package helper
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func GetDomainBase() string {
|
||||
domainBase, domainExists := os.LookupEnv("DOMAIN_BASE")
|
||||
|
||||
if !domainExists {
|
||||
os.Setenv("DOMAIN_BASE", "http://localhost:8080")
|
||||
domainBase = "http://localhost:8080"
|
||||
}
|
||||
|
||||
return domainBase
|
||||
}
|
||||
|
||||
func GetCacheMapLimit() int {
|
||||
cacheMapLimit, domainExists := os.LookupEnv("CACHE_MAP_LIMIT")
|
||||
|
||||
if !domainExists {
|
||||
os.Setenv("CACHE_MAP_LIMIT", "25")
|
||||
cacheMapLimit = "25"
|
||||
}
|
||||
|
||||
rez, err := strconv.Atoi(cacheMapLimit)
|
||||
if err != nil {
|
||||
return 25
|
||||
}
|
||||
|
||||
return rez
|
||||
}
|
||||
Reference in New Issue
Block a user