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) GetToken ¶
func (s *TokenStore) GetToken(ownerID user.ID, tokenID []byte) *session.PrivateToken
GetToken returns private token corresponding to the given identifiers.
Returns nil is there is no element in storage.
func (*TokenStore) RemoveOldTokens ¶
func (s *TokenStore) RemoveOldTokens(epoch uint64)
RemoveOldTokens removes all tokens expired since provided epoch.
func (*TokenStore) Store ¶
func (s *TokenStore) Store(sk ecdsa.PrivateKey, usr user.ID, id []byte, exp uint64) error
Store saves parameterized private key in-memory.
Click to show internal directories.
Click to hide internal directories.