hugecache

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: AGPL-3.0 Imports: 6 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 struct {
	// contains filtered or unexported fields
}

func NewWithConfig

func NewWithConfig(ctx context.Context, config bigcache.Config) (*Cache, error)

func (*Cache) GetCidToOffsetAndSize

func (r *Cache) GetCidToOffsetAndSize(c cid.Cid) (*indexes.OffsetAndSize, error, bool)

func (*Cache) GetRawCarObject

func (r *Cache) GetRawCarObject(c cid.Cid) (v []byte, err error, has bool)

GetRawCarObject returns the raw CAR object data from the cache if it exists.

func (*Cache) GetSlotToCid

func (r *Cache) GetSlotToCid(slot uint64) (cid.Cid, error, bool)

GetSlotToCid returns the CID for the given slot if it exists in the cache.

func (*Cache) PutCidToOffsetAndSize

func (r *Cache) PutCidToOffsetAndSize(c cid.Cid, oas *indexes.OffsetAndSize) error

func (*Cache) PutRawCarObject

func (r *Cache) PutRawCarObject(c cid.Cid, data []byte) error

PutRawCarObject stores the raw CAR object data.

func (*Cache) PutSlotToCid

func (r *Cache) PutSlotToCid(slot uint64, c cid.Cid) error

PutSlotToCid stores the CID for the given slot.

Jump to

Keyboard shortcuts

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