Documentation
¶
Index ¶
Constants ¶
View Source
const ( PUT operator = "put" DEL operator = "del" )
View Source
const (
CompressThresh = 20
)
Variables ¶
View Source
var ( ErrInMemoryCacheMiss = errors.New("in-memory cache miss") ErrNotNodeOrLease = errors.New("resource is not node or lease") )
Functions ¶
func NewErrorKeys ¶ added in v1.5.0
func NewErrorKeys(aofPath string) *errorKeys
Types ¶
type CacheManager ¶
type CacheManager interface {
CacheResponse(req *http.Request, prc io.ReadCloser, stopCh <-chan struct{}) error
QueryCache(req *http.Request) (runtime.Object, error)
CanCacheFor(req *http.Request) bool
DeleteKindFor(gvr schema.GroupVersionResource) error
QueryCacheResult() CacheResult
}
CacheManager is an adaptor to cache runtime object data into backend storage
func NewCacheManager ¶
func NewCacheManager( storagewrapper StorageWrapper, serializerMgr *serializer.SerializerManager, restMapperMgr *hubmeta.RESTMapperManager, configManager *configuration.Manager, ) CacheManager
NewCacheManager creates a new CacheManager
type CacheResult ¶ added in v1.5.0
type StorageWrapper ¶
type StorageWrapper interface {
Name() string
Create(key storage.Key, obj runtime.Object) error
Delete(key storage.Key) error
Get(key storage.Key) (runtime.Object, error)
List(key storage.Key) ([]runtime.Object, error)
Update(key storage.Key, obj runtime.Object, rv uint64) (runtime.Object, error)
KeyFunc(info storage.KeyBuildInfo) (storage.Key, error)
ListResourceKeysOfComponent(component string, gvr schema.GroupVersionResource) ([]storage.Key, error)
ReplaceComponentList(component string, gvr schema.GroupVersionResource, namespace string, contents map[storage.Key]runtime.Object) error
DeleteComponentResources(component string) error
SaveClusterInfo(key storage.Key, content []byte) error
GetClusterInfo(key storage.Key) ([]byte, error)
GetStorage() storage.Store
GetCacheResult() (int, string)
}
StorageWrapper is wrapper for storage.Store interface in order to handle serialize runtime object
func NewStorageWrapper ¶
func NewStorageWrapper(storage storage.Store) StorageWrapper
NewStorageWrapper create a StorageWrapper object
Click to show internal directories.
Click to hide internal directories.