metadata

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package metadata provides a metadata-specific (concurrent and size-limited) cache.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache is a concurrent size-limited cache. If the cache size reaches maxCacheEntries all existing entries are removed.

maxCacheEntries should effectively be the number of workers in the topology, but rather than expose that information to filters we for now just use an estimated max of 100.

func (*Cache) Load

func (c *Cache) Load(key interface{}) (value interface{}, ok bool)

Load loads from the cache the value that is mapped to key, or bool if the cache doesn't contain key.

func (*Cache) Store

func (c *Cache) Store(key, value interface{})

Store caches key and value in the cache.

Jump to

Keyboard shortcuts

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