kv

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyJwtAccess

func KeyJwtAccess(d string) string

KeyJwtAccess returns the kv key which holds a JWT access token

func KeyJwtRefresh

func KeyJwtRefresh(d string) string

KeyJwtRefresh returns the kv key which holds a JWT refresh token

func KeySession added in v0.0.4

func KeySession() string

KeySession returns the base kv key prefix

Types

type JWT

type JWT interface {
	DeleteJWTAccessToken(ctx context.Context, accessTokenID string) error
	DeleteJWTRefreshToken(ctx context.Context, refreshTokenID string) error
	GetJWTAccessToken(ctx context.Context, accessTokenID string) (string, error)
	GetJWTRefreshToken(ctx context.Context, refreshTokenID string) (string, error)
	SetJWTAccessToken(ctx context.Context, accessTokenID, userID string, expire time.Duration) error
	SetJWTRefreshToken(ctx context.Context, refreshTokenID, userID string, expire time.Duration) error
}

JWT represents a jwt interface for a KV store

type KV

type KV interface {
	JWT
	Close(ctx context.Context) error
}

KV represents a key value store

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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