temporary

package
v0.43.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenStore

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

TokenStore is an in-memory session token store. It allows creating (storing), retrieving and expiring (removing) session tokens. Must be created only via calling NewTokenStore.

func NewTokenStore

func NewTokenStore() *TokenStore

NewTokenStore creates, initializes and returns a new TokenStore instance.

The elements of the instance are stored in the map.

func (*TokenStore) Close

func (s *TokenStore) Close() error

func (*TokenStore) Create

func (*TokenStore) Get

func (s *TokenStore) Get(ownerID user.ID, tokenID []byte) *storage.PrivateToken

Get returns private token corresponding to the given identifiers.

Returns nil is there is no element in storage.

func (*TokenStore) RemoveOld

func (s *TokenStore) RemoveOld(epoch uint64)

RemoveOld removes all tokens expired since provided epoch.

Jump to

Keyboard shortcuts

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