cache

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

View Source
const NodeSize = shared.NodeSize

Variables

View Source
var RootHeightFromWidth = shared.RootHeightFromWidth

Functions

This section is empty.

Types

type CacheReader

type CacheReader = shared.CacheReader

type CacheWriter

type CacheWriter = shared.CacheWriter

type CachingPolicy

type CachingPolicy = shared.CachingPolicy

func Combine

func Combine(first, second CachingPolicy) CachingPolicy

func MinHeightPolicy

func MinHeightPolicy(minHeight uint) CachingPolicy

func SpecificLayersPolicy

func SpecificLayersPolicy(layersToCache map[uint]bool) CachingPolicy

type HashFunc

type HashFunc = shared.HashFunc

type LayerFactory

type LayerFactory = shared.LayerFactory

func MakeSliceReadWriterFactory

func MakeSliceReadWriterFactory() LayerFactory

func MakeSpecificLayersFactory

func MakeSpecificLayersFactory(readWriters map[uint]LayerReadWriter) LayerFactory

type LayerReadWriter

type LayerReadWriter = shared.LayerReadWriter

type LayerReader

type LayerReader = shared.LayerReader

type LayerWriter

type LayerWriter = shared.LayerWriter

type Reader

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

func (*Reader) GetCachingPolicy

func (c *Reader) GetCachingPolicy() CachingPolicy

func (*Reader) GetHashFunc

func (c *Reader) GetHashFunc() HashFunc

func (*Reader) GetLayerFactory

func (c *Reader) GetLayerFactory() LayerFactory

func (*Reader) GetLayerReader

func (c *Reader) GetLayerReader(layerHeight uint) LayerReader

func (*Reader) Layers

func (c *Reader) Layers() map[uint]LayerReadWriter

type Writer

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

func NewWriter

func NewWriter(shouldCacheLayer CachingPolicy, generateLayer LayerFactory) *Writer

func (*Writer) Close

func (c *Writer) Close()

func (*Writer) GetLayerWriter

func (c *Writer) GetLayerWriter(layerHeight uint) (LayerWriter, error)

func (*Writer) GetReader

func (c *Writer) GetReader() (CacheReader, error)

GetReader returns a cache reader that can be passed into GenerateProof. It first flushes the layer writers to support layer writers that have internal buffers that may not be reflected in the reader until flushed. After flushing, this method validates the structure of the cache, including that a base layer is cached.

func (*Writer) SetHash

func (c *Writer) SetHash(hashFunc HashFunc)

func (*Writer) SetLayer

func (c *Writer) SetLayer(layerHeight uint, rw LayerReadWriter)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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