cache

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSize = 100000

DefaultSize determines how big cache should be at the beginning.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func New added in v0.14.0

func New(ttl time.Duration, namespace string) *Cache

func (*Cache) Collect added in v0.14.0

func (c *Cache) Collect(in chan<- prometheus.Metric)

Collect implements prometheus Collector interface.

func (*Cache) Del added in v0.14.0

func (c *Cache) Del(k uint64)

func (*Cache) Describe added in v0.14.0

func (c *Cache) Describe(in chan<- *prometheus.Desc)

Describe implements prometheus Collector interface.

func (*Cache) Put added in v0.14.0

func (c *Cache) Put(k uint64, ses mnemosynerpc.Session)

func (*Cache) Read added in v0.14.0

func (c *Cache) Read(k uint64) (*Entry, bool)

func (*Cache) Refresh added in v0.14.0

func (c *Cache) Refresh(k uint64)

type Entry added in v0.14.0

type Entry struct {
	Ses     mnemosynerpc.Session
	Exp     time.Time
	Refresh bool
}

Jump to

Keyboard shortcuts

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