cache

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func New

func New(client *ent.Client) *Cache

func (*Cache) Drop

func (v *Cache) Drop(id int)

func (*Cache) FindByKey

func (v *Cache) FindByKey(kid types.KeyID) (*Token, bool)

func (*Cache) Patch

func (v *Cache) Patch(kid types.KeyID, key *Token)

Patch updates state in-place. DO NOT use it for mass update - it locks the whole workflow.

func (*Cache) PollKeys

func (v *Cache) PollKeys(ctx context.Context, interval time.Duration)

func (*Cache) Set

func (v *Cache) Set(state State)

func (*Cache) SyncKey

func (v *Cache) SyncKey(ctx context.Context, id int) error

func (*Cache) SyncKeys

func (v *Cache) SyncKeys(ctx context.Context) error

type State

type State map[types.KeyID]*Token

type Token

type Token struct {
	AccessKey *types.AccessKey
	DBToken   *ent.Token
}

Jump to

Keyboard shortcuts

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