1
0
mirror of https://github.com/JustKato/FreePad.git synced 2026-02-23 15:50:46 +02:00

* Basics realized

This commit is contained in:
2022-05-19 00:40:34 +03:00
parent cb58f3e87d
commit 169e20b573
6 changed files with 81 additions and 1849 deletions

33
lib/helper/helper_main.go Normal file
View 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
}