Documentation ¶
Overview ¶
Package tokenrepo holds the repository logic associated with the token domain.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
Redis *redis.Client
}
Repository is data/repository implementation of service layer TokenRepository
func New ¶
func New(redisClient *redis.Client) *Repository
New is a factory for initializing Token Repositories
func (*Repository) DeleteRefreshToken ¶
func (r *Repository) DeleteRefreshToken(ctx context.Context, userID, tokenID string) error
DeleteRefreshToken used to delete old refresh tokens Services my access this to revolve tokens
func (*Repository) DeleteUserRefreshTokens ¶
func (r *Repository) DeleteUserRefreshTokens(ctx context.Context, userID string) error
DeleteUserRefreshTokens looks for all tokens beginning with userID and scans to delete them in a non-blocking fashion
func (*Repository) SetRefreshToken ¶
func (r *Repository) SetRefreshToken(ctx context.Context, userID string, tokenID string, expiresIn time.Duration, ) error
SetRefreshToken stores a refresh token with an expiry time
Click to show internal directories.
Click to hide internal directories.