cache

package
v1.6.10 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const NoExpiration = gocache.NoExpiration

NoExpiration is constant

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache is cache struct

func New

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

New returns new cache instance

func (*Cache) Delete

func (c *Cache) Delete(k string)

Delete deletes cache item

func (*Cache) Get

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

Get gets cache item

func (*Cache) Set

func (c *Cache) Set(k string, x interface{}, d time.Duration)

Set sets cache item

Jump to

Keyboard shortcuts

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