redis

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents a redis client

func New

func New(ctx context.Context) (*Client, error)

New creates a new redis client.

func (*Client) Close

func (c *Client) Close(ctx context.Context) error

Close closes the redis pool

func (*Client) DeleteJWTAccessToken

func (c *Client) DeleteJWTAccessToken(ctx context.Context, accessTokenID string) error

DeleteJWTAccessToken deletes an access token from redis.

func (*Client) DeleteJWTRefreshToken

func (c *Client) DeleteJWTRefreshToken(ctx context.Context, refreshTokenID string) error

DeleteJWTRefreshToken deletes a refresh token from redis.

func (*Client) GetJWTAccessToken

func (c *Client) GetJWTAccessToken(ctx context.Context, accessTokenID string) (string, error)

GetJWTAccessToken retrieves an access token from redis.

func (*Client) GetJWTRefreshToken

func (c *Client) GetJWTRefreshToken(ctx context.Context, refreshTokenID string) (string, error)

GetJWTRefreshToken retrieves an refresh token from redis.

func (*Client) RedisClient added in v0.0.4

func (c *Client) RedisClient() *redis.Client

RedisClient returns the redis client

func (*Client) SetJWTAccessToken

func (c *Client) SetJWTAccessToken(ctx context.Context, accessTokenID, userID string, expire time.Duration) error

SetJWTAccessToken adds an access token to redis.

func (*Client) SetJWTRefreshToken

func (c *Client) SetJWTRefreshToken(ctx context.Context, refreshTokenID string, userID string, expire time.Duration) error

SetJWTRefreshToken adds a refresh token to redis.

Jump to

Keyboard shortcuts

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