redis

package
v0.0.0-...-99a2c5e Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenBlacklist

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

TokenBlacklist is a Redis based token blacklist.

func NewTokenBlacklist

func NewTokenBlacklist(conn redis.Conn) *TokenBlacklist

NewTokenBlacklist returns a new token blacklist based on the provided redis connection.

func (*TokenBlacklist) BlacklistToken

func (b *TokenBlacklist) BlacklistToken(ctx context.Context, tokens ...*cargonaut.Token) error

BlacklistToken blacklists one or more tokens by putting them onto the token blacklist. The tokens are identified by their unique token ID.

func (*TokenBlacklist) IsTokenBlacklisted

func (b *TokenBlacklist) IsTokenBlacklisted(ctx context.Context, id uuid.UUID) (bool, error)

IsTokenBlacklisted retrieves a token by its unique token ID and returns true if it is blacklisted.

Jump to

Keyboard shortcuts

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