tokenredis

package module
v0.0.0-...-2e75a80 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 6 Imported by: 0

README

Token - Redis Storage

License

Installation

Use go get.

go get github.com/go-funcards/token-redis

Then import token-redis package into your own code.

import "github.com/go-funcards/token-redis"

License

Distributed under MIT License, please see license file within the code for more details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg token.Config, generator jwt.Generator, rdb *redis.Client) token.Service

Types

type Storage

type Storage struct {
	Redis *redis.Client
}

func (*Storage) Del

func (s *Storage) Del(ctx context.Context, refreshToken string)

func (*Storage) Get

func (s *Storage) Get(ctx context.Context, refreshToken string) (user jwt.User, err error)

func (*Storage) Set

func (s *Storage) Set(ctx context.Context, refreshToken string, user jwt.User, expiration time.Duration) error

Jump to

Keyboard shortcuts

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