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

+ Maximum pad length

+ Configurable maximum pad length
+ Refresh pad
+ Archive pad
+ Archives in local client storage
+ Download pad
This commit is contained in:
2022-05-21 16:17:25 +03:00
parent b079c0f637
commit e781daec89
8 changed files with 326 additions and 73 deletions

View File

@@ -16,6 +16,28 @@ func GetDomainBase() string {
return domainBase
}
func GetMaximumPadSize() int {
// Lookup if the maximum pad size variable exists.
maxPadSize, exists := os.LookupEnv("MAXIMUM_PAD_SIZE")
// Check if this environment variable has bee nset
if !exists {
// Set the variable ourselves to the default string value
maxPadSize = "524288"
}
// Try and convert the string into an integer
rez, err := strconv.Atoi(maxPadSize)
// Check if the conversion has failed
if err != nil {
// Simply return the default
return 524288
}
// Return the resulting value
return rez
}
func GetCacheMapLimit() int {
cacheMapLimit, domainExists := os.LookupEnv("CACHE_MAP_LIMIT")