blockcache

package
v0.0.0-...-371cdc4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockCache

type BlockCache struct {
	// Current number of elements in the cache
	Size int

	// Maximum number of elements in the cache.
	CacheSize int

	// Size of block allocation for cache elements.
	BlockSize int

	Pool sync.Pool
	// contains filtered or unexported fields
}

func New

func New(cacheSize, blockSize int) *BlockCache

func (*BlockCache) Access

func (c *BlockCache) Access(groupKey, key interface{}, create bool, accessFunc func(tag interface{}, buf []byte, found bool) (newTag interface{}, modified bool, err error)) error

func (*BlockCache) Flush

func (c *BlockCache) Flush(groupKey interface{}, key interface{}) error

func (*BlockCache) FlushGroup

func (c *BlockCache) FlushGroup(groupKey interface{}) error

func (*BlockCache) RemoveGroup

func (c *BlockCache) RemoveGroup(groupKey interface{}) error

type Flushable

type Flushable interface {
	FlushBlock(key interface{}, tag interface{}, buf []byte) (interface{}, error)
}

Jump to

Keyboard shortcuts

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