storage

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TTLCacheResetDefault = 24 * time.Hour
	TTLCacheDefault      = 5 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key = string

type Store

type Store struct {
	TTL time.Duration
	// contains filtered or unexported fields
}

func New

func New(ttl time.Duration, autoCleanTimeout time.Duration) *Store

func (*Store) Delete

func (c *Store) Delete(k Key)

func (*Store) Get

func (c *Store) Get(k Key) (interface{}, bool)

func (*Store) GetTTL

func (c *Store) GetTTL(k Key, ttl time.Duration) (interface{}, bool)

func (*Store) RemoveAll

func (c *Store) RemoveAll()

func (*Store) Set

func (c *Store) Set(k Key, v interface{})

type StoreI

type StoreI interface {
	Get(Key) (interface{}, bool)
	Set(Key, interface{})
}

type StoreMap

type StoreMap = map[Key]Value

type Value

type Value = struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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