mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-05 09:01:06 +00:00
1. Fix lint errors for the whole directory staging/src/k8s.io/client-go/tools/cache;
2. Remove staging/src/k8s.io/client-go/tools/cache from .golint_failures; 3. Fix some typo from comments. Kubernetes-commit: 0e0e1f7daba0a6ae6dd59df0a1bb643c323ad8cb
This commit is contained in:
committed by
Kubernetes Publisher
parent
579ad46bdc
commit
2b8d87c082
3
tools/cache/expiration_cache_fakes.go
vendored
3
tools/cache/expiration_cache_fakes.go
vendored
@@ -33,16 +33,19 @@ func (c *fakeThreadSafeMap) Delete(key string) {
|
||||
}
|
||||
}
|
||||
|
||||
// FakeExpirationPolicy keeps the list for keys which never expires.
|
||||
type FakeExpirationPolicy struct {
|
||||
NeverExpire sets.String
|
||||
RetrieveKeyFunc KeyFunc
|
||||
}
|
||||
|
||||
// IsExpired used to check if object is expired.
|
||||
func (p *FakeExpirationPolicy) IsExpired(obj *TimestampedEntry) bool {
|
||||
key, _ := p.RetrieveKeyFunc(obj)
|
||||
return !p.NeverExpire.Has(key)
|
||||
}
|
||||
|
||||
// NewFakeExpirationStore creates a new instance for the ExpirationCache.
|
||||
func NewFakeExpirationStore(keyFunc KeyFunc, deletedKeys chan<- string, expirationPolicy ExpirationPolicy, cacheClock clock.Clock) Store {
|
||||
cacheStorage := NewThreadSafeStore(Indexers{}, Indices{})
|
||||
return &ExpirationCache{
|
||||
|
Reference in New Issue
Block a user