cache

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: MIT Imports: 2 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 interface {
	Read(string) interface{}
	Write(string, interface{}, time.Duration) error
	Delete(string)
	Clear()
}

Cache is an interface for caches

type GoCache

type GoCache struct {
	cache.Cache
}

func NewGoCache

func NewGoCache(defaultExpiration, cleanupInterval time.Duration) *GoCache

NewGoCache creates a new GoCache.

func (*GoCache) Clear

func (c *GoCache) Clear()

func (*GoCache) Read

func (c *GoCache) Read(key string) interface{}

func (*GoCache) Write

func (c *GoCache) Write(key string, item interface{}, exp time.Duration) error

For oauth2, exp being 0 means no expiration

Jump to

Keyboard shortcuts

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