Documentation ¶
Index ¶
- func NewTokenStoreFactory[C any](keyPrefix string, getClient func() *redis.Client) func() TokenStore[C]
- type Node
- type NodeWithClient
- type Point
- type TokenStore
- func (store TokenStore[C]) CreateStorePoint(ctx context.Context, valid time.Duration, claims *C) (uint64, error)
- func (store TokenStore[C]) CreateStorePointWithID(ctx context.Context, id uint64, valid time.Duration, claims *C) error
- func (store TokenStore[C]) MPointGet(ctx context.Context, ids ...uint64) ([]interface{}, error)
- func (store TokenStore[C]) NewStorePoint(id uint64) Point[C]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTokenStoreFactory ¶ added in v1.19.22
func NewTokenStoreFactory[C any](keyPrefix string, getClient func() *redis.Client) func() TokenStore[C]
NewTokenStoreFactory only support maximum 128 partial program instance, and maximum 1 year validate of token.
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 128. ID uint64 // use for refresh fields. Lock *sync.Mutex IDTimeMark uint64 TokenID *atomic.Uint64 // contains filtered or unexported fields }
func (*Node) WithClient ¶ added in v1.19.22
func (node *Node) WithClient(client *redis.Client) NodeWithClient
type NodeWithClient ¶ added in v1.19.22
type NodeWithClient struct { *Node // contains filtered or unexported fields }
type TokenStore ¶
type TokenStore[C any] struct { // contains filtered or unexported fields }
func (TokenStore[C]) CreateStorePoint ¶
func (TokenStore[C]) CreateStorePointWithID ¶ added in v1.17.36
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]
Click to show internal directories.
Click to hide internal directories.