redis

package
v0.0.0-...-9d3d7fb Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(redisAddr, redisPassword string, redisEmailDB, redisAccessTokenDB, redisRefreshTokenDB int) (db.RedisClient, error)

Connecting to a redis database

Types

type RedisClients

type RedisClients struct {
	EmailClient        *redis.Client
	AccessTokenClient  *redis.Client
	RefreshTokenClient *redis.Client
}

func (*RedisClients) AddEmailData

func (c *RedisClients) AddEmailData(ctx context.Context, data interface{}) (key string, err error)

func (*RedisClients) CheckTokens

func (c *RedisClients) CheckTokens(ctx context.Context, userId int) (accessToken, refreshToken string, err error)

func (*RedisClients) CreateTokens

func (c *RedisClients) CreateTokens(ctx context.Context, userId int) (accessToken, refreshToken string, err error)

func (*RedisClients) DeleteAccessTokensData

func (c *RedisClients) DeleteAccessTokensData(ctx context.Context, userId int) (err error)

func (*RedisClients) DeleteEmailData

func (c *RedisClients) DeleteEmailData(ctx context.Context, key string) (err error)

func (*RedisClients) DeleteRefreshTokensData

func (c *RedisClients) DeleteRefreshTokensData(ctx context.Context, userId int) (err error)

func (*RedisClients) GetEmailData

func (c *RedisClients) GetEmailData(ctx context.Context, key string) (val string, err error)

func (*RedisClients) GetUserData

func (c *RedisClients) GetUserData(ctx context.Context, key string) (userParam models.Users, err error)

func (*RedisClients) VerifyRefreshToken

func (c *RedisClients) VerifyRefreshToken(ctx context.Context, tokenString string) int

func (*RedisClients) VerifyToken

func (c *RedisClients) VerifyToken(ctx context.Context, tokenString string) int

Jump to

Keyboard shortcuts

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