redis

package
v0.0.0-...-89b6d9c Latest Latest
Warning

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

Go to latest
Published: Apr 17, 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) DeleteFediNodeInfo

func (f *Client) DeleteFediNodeInfo(ctx context.Context, domain string) error

DeleteFediNodeInfo deletes fedi nodeinfo from redis.

func (*Client) DeleteJWTAccessToken

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

DeleteJWTAccessToken deletes an access token from redis.

func (*Client) DeleteJWTRefreshToken

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

DeleteJWTRefreshToken deletes a refresh token from redis.

func (*Client) GetFediNodeInfo

func (f *Client) GetFediNodeInfo(ctx context.Context, domain string) (string, error)

GetFediNodeInfo retrieves fedi nodeinfo from redis.

func (*Client) GetJWTAccessToken

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

GetJWTAccessToken retrieves an access token from redis.

func (*Client) GetJWTRefreshToken

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

GetJWTRefreshToken retrieves an refresh token from redis.

func (*Client) RedisClient

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

RedisClient returns the redis client

func (*Client) SetFediNodeInfo

func (f *Client) SetFediNodeInfo(ctx context.Context, domain string, nodeinfo string, expire time.Duration) error

SetFediNodeInfo adds fedi nodeinfo to redis.

func (*Client) SetJWTAccessToken

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

SetJWTAccessToken adds an access token to redis.

func (*Client) SetJWTRefreshToken

func (j *Client) SetJWTRefreshToken(ctx context.Context, refreshTokenID string, userID int64, 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