cache

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package cache wraps wal to handle local disk cache.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExceedCapacity = errors.New("exceed cache max capacity")
	ErrCacheClosed    = errors.New("cache closed")
)

Functions

This section is empty.

Types

type Cache

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

func New

func New(path string, capacity uint64) (*Cache, error)

func (*Cache) Clear

func (c *Cache) Clear() error

func (*Cache) Close

func (c *Cache) Close() error

func (*Cache) Get

func (c *Cache) Get(fn Fn) error

func (*Cache) Put

func (c *Cache) Put(data []byte) error

type Fn

type Fn func([]byte) error

Jump to

Keyboard shortcuts

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