cache

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenValidator

type TokenValidator interface {
	Set(id string, value interface{}, period time.Duration) error
	Has(id string) (bool, error)
	Get(id string) (interface{}, bool)
	Delete(id string) error
}

TokenValidator interface

type TokenValidatorService

type TokenValidatorService struct {
	gocachetimed.Cache
}

TokenValidatorService struct

func NewTokenValidatorService

func NewTokenValidatorService() *TokenValidatorService

NewTokenValidatorService creates a new token validator service

func (*TokenValidatorService) Delete

func (t *TokenValidatorService) Delete(id string) error

Delete deletes a token from the cache

func (*TokenValidatorService) Get

func (t *TokenValidatorService) Get(id string) (interface{}, bool)

Get gets a token from the cache

func (*TokenValidatorService) Has

func (t *TokenValidatorService) Has(id string) (bool, error)

Has checks if a token exists in the cache

func (*TokenValidatorService) Set

func (t *TokenValidatorService) Set(
	id string,
	value interface{},
	period time.Duration,
) error

Set sets a token in the cache

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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