tokencacher

package
v0.0.0-...-37d652e Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const RedisDefaultKey = "athena_token"

Variables

View Source
var ErrTokenExpired = errors.New("token expired")
View Source
var ErrTokenNotExist = errors.New("token does not exist")

Functions

This section is empty.

Types

type Default

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

func NewDefault

func NewDefault() *Default

func (*Default) Get

func (d *Default) Get(ctx context.Context) (string, error)

func (*Default) Set

func (d *Default) Set(ctx context.Context, token string, expiresAt time.Time) error

type File

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

func NewFile

func NewFile(path string) *File

func (*File) Get

func (f *File) Get(ctx context.Context) (string, error)

func (*File) Set

func (f *File) Set(ctx context.Context, token string, expiresAt time.Time) error

type Redis

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

func NewRedis

func NewRedis(client *redis.Client, key string) *Redis

func (*Redis) Get

func (r *Redis) Get(ctx context.Context) (string, error)

func (*Redis) Set

func (r *Redis) Set(ctx context.Context, token string, expiresAt time.Time) error

Jump to

Keyboard shortcuts

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