Documentation ¶
Overview ¶
Package cacheadapters contains the generic entities used to access the cache.
In this package you will find the CacheAdapter and CacheSessionAdapter interfaces, used by the specific implementations to access the cache, along with a MultiCacheProvider struct you can use to access multiple cache adapters with an index-based priority mechanism.
If you want to see the specific implementations go to the folder with the name of the implementation you are searching (e.g. "redis").
Index ¶
Constants ¶
View Source
const TTLExpired time.Duration = 0
TTLExpired represents the zero-value of a time expiration.
Variables ¶
View Source
var ( // ErrNotFound will come out if a key is not found in the cache. ErrNotFound = fmt.Errorf("the value tried to get has not been found, check if it may be expired") // ErrGetRequiresObjectReference will come out if a nil object // reference is passed in a Get operation. ErrGetRequiresObjectReference = fmt.Errorf("in Get operations it is mandatory to provide a non-nil object reference to store the result in, nil found") // ErrInvalidTTL will come out if you try to set a zero-or-negative // TTL in a Set operation. ErrInvalidTTL = fmt.Errorf("cannot provide a negative TTL to Set operations") )
Functions ¶
This section is empty.
Types ¶
type CacheAdapter ¶
type CacheAdapter interface { // OpenSession opens a new Cache Session. OpenSession() (CacheSessionAdapter, error) // contains filtered or unexported methods }
CacheAdapter represents a Cache Mechanism abstraction.
type CacheSessionAdapter ¶
type CacheSessionAdapter interface { // Close closes the Cache Session. Close() error // contains filtered or unexported methods }
CacheSessionAdapter represents a Cache Session Mechanism abstraction.
Directories ¶
Path | Synopsis |
---|---|
Package inmemorycacheadapters contains the implementations of CacheAdapter and CacheSessionAdapter for in-memory cache, along with some helper methods to create instances.
|
Package inmemorycacheadapters contains the implementations of CacheAdapter and CacheSessionAdapter for in-memory cache, along with some helper methods to create instances. |
Package mongodbcacheadapters contains the implementations of CacheAdapter and CacheSessionAdapter for a MongoDB instance based cache, along with some helper methods to create instances.
|
Package mongodbcacheadapters contains the implementations of CacheAdapter and CacheSessionAdapter for a MongoDB instance based cache, along with some helper methods to create instances. |
Package multicacheadapters contains the implementations of CacheAdapter and CacheSessionAdapter with the objective of accessing multiple cache sources with fallback support.
|
Package multicacheadapters contains the implementations of CacheAdapter and CacheSessionAdapter with the objective of accessing multiple cache sources with fallback support. |
Package rediscacheadapters contains the implementations of CacheAdapter and CacheSessionAdapter for Redis clusters, along with some helper methods to create instances.
|
Package rediscacheadapters contains the implementations of CacheAdapter and CacheSessionAdapter for Redis clusters, along with some helper methods to create instances. |
Click to show internal directories.
Click to hide internal directories.