- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 12 for lruCache (0.13 sec)
-
plugin/pkg/admission/eventratelimit/cache.go
func (c *singleCache) get(key interface{}) flowcontrol.RateLimiter { return c.rateLimiter } // lruCache is a least-recently-used cache type lruCache struct { // factory to use to create new rate limiters rateLimiterFactory func() flowcontrol.RateLimiter // the actual LRU cache cache *lru.Cache } func (c *lruCache) get(key interface{}) flowcontrol.RateLimiter { value, found := c.cache.Get(key) if !found {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Thu Jul 08 02:31:37 UTC 2021 - 1.6K bytes - Viewed (0) -
pkg/kubelet/clustertrustbundle/clustertrustbundle_manager.go
import ( "encoding/pem" "fmt" "math/rand" "time" certificatesv1alpha1 "k8s.io/api/certificates/v1alpha1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" lrucache "k8s.io/apimachinery/pkg/util/cache" "k8s.io/apimachinery/pkg/util/sets" certinformersv1alpha1 "k8s.io/client-go/informers/certificates/v1alpha1" certlistersv1alpha1 "k8s.io/client-go/listers/certificates/v1alpha1"
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri Nov 03 18:40:48 UTC 2023 - 8.3K bytes - Viewed (0) -
plugin/pkg/admission/eventratelimit/cache_test.go
} nextRateLimiter := 0 rateLimiterFactory := func() flowcontrol.RateLimiter { rateLimiter := rateLimiters[nextRateLimiter] nextRateLimiter++ return rateLimiter } underlyingCache := lru.New(2) cache := lruCache{ rateLimiterFactory: rateLimiterFactory, cache: underlyingCache, } cases := []struct { name string key int expected flowcontrol.RateLimiter }{ {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Thu Jul 08 02:31:37 UTC 2021 - 2.7K bytes - Viewed (0) -
plugin/pkg/admission/eventratelimit/limitenforcer.go
}, keyFunc: getServerKey, }, nil } cacheSize := int(config.CacheSize) if cacheSize == 0 { cacheSize = defaultCacheSize } underlyingCache := lru.New(cacheSize) cache := &lruCache{ rateLimiterFactory: rateLimiterFactory, cache: underlyingCache, } var keyFunc func(admission.Attributes) string switch t := config.Type; t { case eventratelimitapi.NamespaceLimitType:
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Thu Jul 08 02:31:37 UTC 2021 - 3.8K bytes - Viewed (0) -
pkg/cache/ttlCache.go
// ttlWrapper type makes it so we control the exposure of the underlying ttlCache pointer. // When the pointer to ttlWrapper is finalized, this tells us to go ahead and stop the // evicter goroutine, which allows the lruCache instance to be collected and everything // ends well. // See use of SetFinalizer below for an explanation of this weird composition type ttlWrapper struct { *ttlCache } type ttlCache struct {
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Tue May 23 17:08:31 UTC 2023 - 7.8K bytes - Viewed (0) -
docs_src/settings/app03_an_py39/main.py
from functools import lru_cache from fastapi import Depends, FastAPI from typing_extensions import Annotated from . import config app = FastAPI() @lru_cache def get_settings(): return config.Settings() @app.get("/info") async def info(settings: Annotated[config.Settings, Depends(get_settings)]): return { "app_name": settings.app_name, "admin_email": settings.admin_email,
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Tue Oct 24 20:26:06 UTC 2023 - 462 bytes - Viewed (0) -
docs_src/settings/app03/main.py
from functools import lru_cache from fastapi import Depends, FastAPI from . import config app = FastAPI() @lru_cache def get_settings(): return config.Settings() @app.get("/info") async def info(settings: config.Settings = Depends(get_settings)): return { "app_name": settings.app_name, "admin_email": settings.admin_email, "items_per_user": settings.items_per_user,
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Tue Oct 24 20:26:06 UTC 2023 - 412 bytes - Viewed (0) -
docs_src/settings/app02_an/main.py
from functools import lru_cache from fastapi import Depends, FastAPI from typing_extensions import Annotated from .config import Settings app = FastAPI() @lru_cache def get_settings(): return Settings() @app.get("/info") async def info(settings: Annotated[Settings, Depends(get_settings)]): return { "app_name": settings.app_name, "admin_email": settings.admin_email,
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Tue Oct 24 20:26:06 UTC 2023 - 456 bytes - Viewed (0) -
docs_src/settings/app03_an/main.py
from functools import lru_cache from typing import Annotated from fastapi import Depends, FastAPI from . import config app = FastAPI() @lru_cache def get_settings(): return config.Settings() @app.get("/info") async def info(settings: Annotated[config.Settings, Depends(get_settings)]): return { "app_name": settings.app_name, "admin_email": settings.admin_email,
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Tue Oct 24 20:26:06 UTC 2023 - 451 bytes - Viewed (0) -
docs_src/settings/app02/main.py
from functools import lru_cache from fastapi import Depends, FastAPI from .config import Settings app = FastAPI() @lru_cache def get_settings(): return Settings() @app.get("/info") async def info(settings: Settings = Depends(get_settings)): return { "app_name": settings.app_name, "admin_email": settings.admin_email, "items_per_user": settings.items_per_user,
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Tue Oct 24 20:26:06 UTC 2023 - 406 bytes - Viewed (0)