getters

package
v0.18.0-not-final-expe... 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: 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) GetSamples

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

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

func (*CascadeGetter) GetSharesByNamespace

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

GetSharesByNamespace gets NamespacedShares 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 GetSharesByNamespace is not supported.

func (*SingleEDSGetter) GetEDS

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

func (*SingleEDSGetter) GetSamples

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

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

func (*SingleEDSGetter) GetSharesByNamespace

GetSharesByNamespace returns NamespacedShares from a kept EDS 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