cache

package
v1.0.49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SandboxCache

type SandboxCache struct {
	Entries map[string]*SandboxCacheEntry `json:"entries,omitempty" xml:"entries,omitempty" yaml:"entries,omitempty"`
	// contains filtered or unexported fields
}

SandboxCache contains cached tokens

func NewSandboxCache

func NewSandboxCache() *SandboxCache

NewSandboxCache returns SandboxCache instance.

func (*SandboxCache) Add

func (c *SandboxCache) Add(sandboxID string, u *user.User) error

Add adds user to the cache.

func (*SandboxCache) Delete

func (c *SandboxCache) Delete(sandboxID string) error

Delete removes cached user entry.

func (*SandboxCache) Expire

func (c *SandboxCache) Expire(sandboxID string)

Expire expires a particular sandbox entry.

func (*SandboxCache) Get

func (c *SandboxCache) Get(sandboxID string) (*user.User, error)

Get returns cached user entry.

func (*SandboxCache) GetCleanupInterval

func (c *SandboxCache) GetCleanupInterval() int

GetCleanupInterval returns cleanup interval.

func (*SandboxCache) GetMaxEntryLifetime

func (c *SandboxCache) GetMaxEntryLifetime() int

GetMaxEntryLifetime returns max entry lifetime.

func (*SandboxCache) Run

func (c *SandboxCache) Run()

Run starts management of SandboxCache instance.

func (*SandboxCache) SetCleanupInterval

func (c *SandboxCache) SetCleanupInterval(i int) error

SetCleanupInterval sets cache management interval.

func (*SandboxCache) SetMaxEntryLifetime

func (c *SandboxCache) SetMaxEntryLifetime(i int) error

SetMaxEntryLifetime sets cache management max entry lifetime in seconds.

func (*SandboxCache) Stop

func (c *SandboxCache) Stop()

Stop stops management of SandboxCache instance.

type SandboxCacheEntry

type SandboxCacheEntry struct {
	// contains filtered or unexported fields
}

SandboxCacheEntry is an entry in SandboxCache.

func (*SandboxCacheEntry) Valid

func (e *SandboxCacheEntry) Valid(max int) error

Valid checks whether SandboxCacheEntry is non-expired.

type SessionCache

type SessionCache struct {
	Entries map[string]*SessionCacheEntry `json:"entries,omitempty" xml:"entries,omitempty" yaml:"entries,omitempty"`
	// contains filtered or unexported fields
}

SessionCache contains cached tokens

func NewSessionCache

func NewSessionCache() *SessionCache

NewSessionCache returns SessionCache instance.

func (*SessionCache) Add

func (c *SessionCache) Add(sessionID string, u *user.User) error

Add adds user to the cache.

func (*SessionCache) Delete

func (c *SessionCache) Delete(sessionID string) error

Delete removes cached user entry.

func (*SessionCache) Get

func (c *SessionCache) Get(sessionID string) (*user.User, error)

Get returns cached user entry.

func (*SessionCache) GetCleanupInterval

func (c *SessionCache) GetCleanupInterval() int

GetCleanupInterval returns cleanup interval.

func (*SessionCache) Run

func (c *SessionCache) Run()

Run starts management of SessionCache instance.

func (*SessionCache) SetCleanupInterval

func (c *SessionCache) SetCleanupInterval(i int) error

SetCleanupInterval sets cache management interval.

func (*SessionCache) Stop

func (c *SessionCache) Stop()

Stop stops management of SessionCache instance.

type SessionCacheEntry

type SessionCacheEntry struct {
	// contains filtered or unexported fields
}

SessionCacheEntry is an entry in SessionCache.

func (*SessionCacheEntry) Valid

func (e *SessionCacheEntry) Valid() error

Valid checks whether SessionCacheEntry is not expired.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL