Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[VT any] interface { Get(key string) (*VT, error) Set(key string, value VT) error Remove(key string) Flush() }
func NewMemoryCache ¶
type MemoryCache ¶
type MemoryCache[T any] struct { // contains filtered or unexported fields }
MemoryCache is the MemoryCache instance to manage session MemoryCache
func (*MemoryCache[T]) Flush ¶
func (c *MemoryCache[T]) Flush()
Flush removes all element from the MemoryCache
func (*MemoryCache[T]) Get ¶
func (c *MemoryCache[T]) Get(key string) (*T, error)
Get returns the user session T with respect to a key
func (*MemoryCache[T]) Remove ¶
func (c *MemoryCache[T]) Remove(key string)
Remove deletes a key from SessionCache map
func (*MemoryCache[T]) Set ¶
func (c *MemoryCache[T]) Set(key string, value T) error
Set sets a session T with respect to a key
Click to show internal directories.
Click to hide internal directories.