cache

package
v0.18.4 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 4 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 NewCache

func NewCache(size int) (*Cache, error)

func (*Cache) AddBlock

func (c *Cache) AddBlock(blk *block.Block)

func (*Cache) AddCertificate

func (c *Cache) AddCertificate(cert *certificate.Certificate)

func (*Cache) Clear

func (c *Cache) Clear()

func (*Cache) GetBlock

func (c *Cache) GetBlock(height uint32) *block.Block

func (*Cache) GetCertificate

func (c *Cache) GetCertificate(height uint32) *certificate.Certificate

func (*Cache) HasBlockInCache

func (c *Cache) HasBlockInCache(height uint32) bool

func (*Cache) Len

func (c *Cache) Len() int

Len returns the maximum number of items in the blocks and certificates cache.

func (*Cache) RemoveBlock added in v0.17.0

func (c *Cache) RemoveBlock(height uint32)

RemoveBlock removes the block and certificates at the specified height from the cache.

Jump to

Keyboard shortcuts

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