getters

package
v0.20.4-test5 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestGetter

func TestGetter(t *testing.T) (shwap.Getter, *header.ExtendedHeader)

TestGetter provides a testing SingleEDSGetter and the root of the EDS it holds.

Types

type CascadeGetter

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

CascadeGetter implements custom shwap.Getter that composes multiple Getter implementations in "cascading" order.

See cascade func for details on cascading.

func NewCascadeGetter

func NewCascadeGetter(getters []shwap.Getter) *CascadeGetter

NewCascadeGetter instantiates a new CascadeGetter from given shwap.Getters with given interval.

func (*CascadeGetter) GetEDS

GetEDS gets a full EDS from any of registered shwap.Getters in cascading order.

func (*CascadeGetter) GetNamespaceData

func (cg *CascadeGetter) GetNamespaceData(
	ctx context.Context,
	header *header.ExtendedHeader,
	namespace libshare.Namespace,
) (shwap.NamespaceData, error)

GetNamespaceData gets NamespacedShares from any of registered shwap.Getters in cascading order.

func (*CascadeGetter) GetSamples added in v0.20.4

func (cg *CascadeGetter) GetSamples(ctx context.Context, hdr *header.ExtendedHeader,
	indices []shwap.SampleCoords,
) ([]shwap.Sample, error)

GetSamples gets samples from any of registered shwap.Getters in cascading order.

type SingleEDSGetter

type SingleEDSGetter struct {
	EDS eds.Rsmt2D
}

SingleEDSGetter contains a single EDS where data is retrieved from. Its primary use is testing, and GetNamespaceData is not supported.

func (*SingleEDSGetter) GetEDS

GetEDS returns a kept EDS if the correct root is given.

func (*SingleEDSGetter) GetNamespaceData

GetNamespaceData returns NamespacedShares from a kept EDS if the correct root is given.

func (*SingleEDSGetter) GetSamples added in v0.20.4

func (seg *SingleEDSGetter) GetSamples(ctx context.Context, hdr *header.ExtendedHeader,
	indices []shwap.SampleCoords,
) ([]shwap.Sample, error)

GetSamples get samples from a kept EDS if exist and if the correct root is given.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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