Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { // Set adds item to cache replacing existing one Set( cx context.Context, kye string, val []byte, ) // Add adds item to cache only if the item doesn't exist or // the key has expired. It won't remove an active existing value Add( cx context.Context, key string, val []byte, ) error // Replace an item if it exists Replace( cx context.Context, key string, val []byte, ) error // SetWithDuration sets the key with a value for a time period SetWithDuration( cx context.Context, key string, val []byte, expiration time.Duration, ) // Get returns the value for the key from the cache and sets found flag as // true or it returns false if the value is not found Get( cx context.Context, key string, ) (val []byte, found bool) // Delete deletes the key from the cache, and doesn't do anything // if key is not found Delete( cx context.Context, key string, ) }
func NewInMemoryCache ¶
Click to show internal directories.
Click to hide internal directories.