mirror of
https://github.com/Alvin-Zilverstand/nginx-proxy-manager.git
synced 2026-11-24 15:13:07 +01:00
Moved v3 code from NginxProxyManager/nginx-proxy-manager-3 to NginxProxyManager/nginx-proxy-manager
This commit is contained in:
1 parent
4db34f5894
commit
2110ecc382
830 files changed
+38168
-36635
No files matched your search
@@ -0,0 +1,23 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"npm/internal/logger"
|
||||
|
||||
cache "github.com/patrickmn/go-cache"
|
||||
)
|
||||
|
||||
// AuthCache is a cache item that stores the Admin API data for each admin that has been requesting endpoints
|
||||
var AuthCache *cache.Cache
|
||||
|
||||
// AuthCacheInit will create a new Memory Cache
|
||||
func AuthCacheInit() {
|
||||
logger.Debug("Creating a new AuthCache")
|
||||
AuthCache = cache.New(1*time.Minute, 5*time.Minute)
|
||||
}
|
||||
|
||||
// AuthCacheSet will store the item in memory for the expiration time
|
||||
func AuthCacheSet(k string, x interface{}) {
|
||||
AuthCache.Set(k, x, cache.DefaultExpiration)
|
||||
}
|
||||
Reference in new issue
Block a user