store

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound       = errors.New("proposal not found")
	ErrLayerEvicted   = errors.New("layer evicted")
	ErrProposalExists = errors.New("proposal already exists")
)

Functions

This section is empty.

Types

type Store

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

func New

func New(opts ...StoreOption) *Store

func (*Store) Add

func (s *Store) Add(p *types.Proposal) error

func (*Store) Get

func (s *Store) Get(layer types.LayerID, id types.ProposalID) *types.Proposal

func (*Store) GetBlob

func (s *Store) GetBlob(id types.ProposalID) ([]byte, error)

func (*Store) GetBlobSize added in v1.4.1

func (s *Store) GetBlobSize(id types.ProposalID) (int, error)

func (*Store) GetForLayer

func (s *Store) GetForLayer(layer types.LayerID) []*types.Proposal

func (*Store) GetMany

func (s *Store) GetMany(layer types.LayerID, pids ...types.ProposalID) []*types.Proposal

func (*Store) Has

func (s *Store) Has(id types.ProposalID) bool

func (*Store) IsEvicted

func (s *Store) IsEvicted(layer types.LayerID) bool

func (*Store) OnLayer

func (s *Store) OnLayer(layer types.LayerID)

type StoreOption

type StoreOption func(*Store)

func WithCapacity

func WithCapacity(capacity uint32) StoreOption

func WithEvictedLayer

func WithEvictedLayer(layer types.LayerID) StoreOption

func WithLogger

func WithLogger(logger *zap.Logger) StoreOption

Jump to

Keyboard shortcuts

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