scriptcache

package
Version: v0.0.0-...-9e745d5 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(defaultExpiration, cleanupInterval time.Duration) *Cache

New - create nnew cache

func (*Cache) Delete

func (c *Cache) Delete(key string) error

Delete - delete values in cache

func (*Cache) GC

func (c *Cache) GC()

GC - garbage collector from cache

func (*Cache) Get

func (c *Cache) Get(key string) (interface{}, bool)

Get - get value in cache

func (*Cache) Set

func (c *Cache) Set(key string, value interface{}, duration time.Duration)

func (*Cache) StartGC

func (c *Cache) StartGC()

StartGC - init GC

type Item

type Item struct {
	Value      interface{}
	Created    time.Time
	Expiration int64
}

Source Files

Jump to

Keyboard shortcuts

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