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:
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user