Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { // Add adds a key in the cache with an expiration time Add(key string, expiresIn time.Duration) error // Remove removes a key from the cache Remove(key string) // Contains returns true if the key is in the cache and was not expired Contains(key string) bool }
The Cache interface defines the methods that a cache implementation should have
type InMemory ¶
type InMemory struct {
// contains filtered or unexported fields
}
InMemory is a simple Cache implementation used for testing and examples
func NewInMemory ¶
func NewInMemory() *InMemory
Click to show internal directories.
Click to hide internal directories.