Documentation
¶
Index ¶
- type InMemoryCache
- func (c *InMemoryCache) Clear() error
- func (c *InMemoryCache) Delete(tokenHash string) error
- func (c *InMemoryCache) Get(tokenHash string) (*core.Session, error)
- func (c *InMemoryCache) Len() int
- func (c *InMemoryCache) Set(tokenHash string, session *core.Session) error
- func (c *InMemoryCache) Stats() core.CacheStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemoryCache ¶
type InMemoryCache struct {
// contains filtered or unexported fields
}
InMemoryCache implements an in-memory session cache
func NewInMemoryCache ¶
func NewInMemoryCache(c core.CacheConfig) *InMemoryCache
NewInMemoryCache creates a new in-memory cache
func (*InMemoryCache) Clear ¶
func (c *InMemoryCache) Clear() error
Clear removes all sessions from cache
func (*InMemoryCache) Delete ¶
func (c *InMemoryCache) Delete(tokenHash string) error
Delete removes a session from cache
func (*InMemoryCache) Get ¶
func (c *InMemoryCache) Get(tokenHash string) (*core.Session, error)
Get retrieves a session from cache
func (*InMemoryCache) Len ¶
func (c *InMemoryCache) Len() int
Len returns the number of cached sessions
func (*InMemoryCache) Set ¶
func (c *InMemoryCache) Set(tokenHash string, session *core.Session) error
Set stores a session in cache
func (*InMemoryCache) Stats ¶
func (c *InMemoryCache) Stats() core.CacheStats
Stats returns cache statistics
Click to show internal directories.
Click to hide internal directories.