Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrSetCache = errors.New("set cache error")
ErrSetCache is returned when the cache is set.
Functions ¶
func NewErrSetCache ¶
NewErrSetCache returns a new ErrSetCache.
Types ¶
type BaseCacheStore ¶
type BaseCacheStore interface { kv.Store // SetStore sets a base key-value store. SetStore(s kv.Store) // RegisterCacheKeyPrefix registers a key header for the cache store. RegisterCacheKeyHeader(header kv.KeyHeader) // IsRegisteredCacheKey returns true if the specified key is registered to the cache store. IsRegisteredCacheKey(key kv.Key) bool // EraseCache deletes a cache for the specified key. EraseCache(key kv.Key) error }
BaseCacheStore represents a base key-value cache store interface.
type BaseStore ¶
type BaseStore struct { plugins.Config kv.Store *CacheConfig }
BaseStore represents a cache store service instance.
func NewBaseStore ¶
func NewBaseStore() *BaseStore
NewStore returns a new FoundationDB store instance.
func (*BaseStore) ServiceType ¶
func (store *BaseStore) ServiceType() plugins.ServiceType
ServiceType returns the plug-ing service type.
type CacheConfig ¶
type CacheConfig struct {
// contains filtered or unexported fields
}
CacheConfig represents a key-value cache store configuration.
func NewCacheConfig ¶
func NewCacheConfig() *CacheConfig
NewCacheConfig returns a new key-value cache store configuration.
func (*CacheConfig) EnableCollectionCache ¶
func (conf *CacheConfig) EnableCollectionCache()
EnableCollectionCache enables a cache for all database collections.
func (*CacheConfig) EnableDatabaseCache ¶
func (conf *CacheConfig) EnableDatabaseCache()
EnableDatabaseCache enables a cache for all databases.
func (*CacheConfig) IsRegisteredCacheKey ¶
func (conf *CacheConfig) IsRegisteredCacheKey(key kv.Key) bool
IsRegisteredCacheKey returns true if the specified key is registered to the cache store.
func (*CacheConfig) RegisterCacheKeyHeader ¶
func (conf *CacheConfig) RegisterCacheKeyHeader(header kv.KeyHeader)
RegisterCacheKeyPrefix registers a key header for the cache store.
func (*CacheConfig) UnregisterCacheKeyHeader ¶
func (conf *CacheConfig) UnregisterCacheKeyHeader(header kv.KeyHeader)
UnregisterCacheKeyPrefix unregisters a key header for the cache store.
type CacheStore ¶
type CacheStore interface { BaseCacheStore // EnableDatabaseCache enables a cache for all databases. EnableDatabaseCache() // EnableCollectionCache enables a cache for all database collections. EnableCollectionCache() // EraseDatabaseCache deletes a cache for the specified database. EraseDatabaseCache(database string) error // EraseCollectionCache deletes a cache for the specified collection. EraseCollectionCache(database string, collection string) error }
CacheStore represents a key-value cache store interface.
type Service ¶
type Service interface { CacheStore plugins.Service }
Service represents a key-value cache store service interface.