pullstorage

package
v1.10.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrDbClosed is used to signal the underlying database was closed
	ErrDbClosed = errors.New("db closed")
)

Functions

This section is empty.

Types

type PullStorer added in v0.6.2

type PullStorer struct {
	storage.Storer
	// contains filtered or unexported fields
}

PullStorer wraps storage.Storer.

func New

func New(storer storage.Storer, logger log.Logger) *PullStorer

New returns a new pullstorage Storer instance.

func (*PullStorer) Cursors added in v0.6.2

func (s *PullStorer) Cursors(ctx context.Context) (curs []uint64, err error)

Cursors gets the last BinID for every bin in the local storage

func (*PullStorer) Get added in v0.6.2

func (s *PullStorer) Get(ctx context.Context, mode storage.ModeGet, addrs ...swarm.Address) ([]swarm.Chunk, error)

Get chunks.

func (*PullStorer) IntervalChunks added in v0.6.2

func (s *PullStorer) IntervalChunks(ctx context.Context, bin uint8, from, to uint64, limit int) ([]swarm.Address, uint64, error)

IntervalChunks collects chunk for a requested interval.

func (*PullStorer) Metrics added in v0.6.2

func (s *PullStorer) Metrics() []prometheus.Collector

func (*PullStorer) Put added in v0.6.2

func (s *PullStorer) Put(ctx context.Context, mode storage.ModePut, chs ...swarm.Chunk) error

Put chunks.

type Storer

type Storer interface {
	// IntervalChunks collects chunk for a requested interval.
	IntervalChunks(ctx context.Context, bin uint8, from, to uint64, limit int) (chunks []swarm.Address, topmost uint64, err error)
	// Cursors gets the last BinID for every bin in the local storage
	Cursors(ctx context.Context) ([]uint64, error)
	// Get chunks.
	Get(ctx context.Context, mode storage.ModeGet, addrs ...swarm.Address) ([]swarm.Chunk, error)
	// Put chunks.
	Put(ctx context.Context, mode storage.ModePut, chs ...swarm.Chunk) error
	// Set chunks.
	Set(ctx context.Context, mode storage.ModeSet, addrs ...swarm.Address) error
	// Has chunks.
	Has(ctx context.Context, addr swarm.Address) (bool, error)
}

Storer is a thin wrapper around storage.Storer. It is used in order to collect and provide information about chunks currently present in the local store.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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