tokenStore

package
v1.19.20-beta0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTokenStoreFactory added in v1.19.22

func NewTokenStoreFactory[C any](Client *redis.Client, keyPrefix string) func() TokenStore[C]

Types

type Node added in v1.19.22

type Node struct {
	// this is a unique id for each node process, it
	// will be reallocated every day.
	// ID must be smaller than 100.
	ID uint64

	// use for refresh fields.
	Lock       *sync.Mutex
	IDTimeMark uint64
	TokenID    *atomic.Uint64
	// contains filtered or unexported fields
}

func (*Node) GenID

func (node *Node) GenID(ctx context.Context) (uint64, error)

type Point

type Point[C any] struct {
	// contains filtered or unexported fields
}

func (Point[C]) Destroy

func (point Point[C]) Destroy(ctx context.Context) error

func (Point[C]) Get

func (point Point[C]) Get(ctx context.Context, claims *C) error

func (Point[C]) GetAndDestroy

func (point Point[C]) GetAndDestroy(ctx context.Context, claims *C) error

type TokenStore

type TokenStore[C any] struct {
	// contains filtered or unexported fields
}

func (TokenStore[C]) CreateStorePoint

func (store TokenStore[C]) CreateStorePoint(ctx context.Context, valid time.Duration, claims *C) (uint64, error)

func (TokenStore[C]) CreateStorePointWithID added in v1.17.36

func (store TokenStore[C]) CreateStorePointWithID(ctx context.Context, id uint64, valid time.Duration, claims *C) error

func (TokenStore[C]) MPointGet added in v1.19.7

func (store TokenStore[C]) MPointGet(ctx context.Context, ids ...uint64) ([]interface{}, error)

func (TokenStore[C]) NewStorePoint

func (store TokenStore[C]) NewStorePoint(id uint64) Point[C]

Jump to

Keyboard shortcuts

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