getters

package
v0.18.0-rc14 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: Apache-2.0 Imports: 19 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) GetShare

func (cg *CascadeGetter) GetShare(
	ctx context.Context, header *header.ExtendedHeader, row, col int,
) (share.Share, error)

GetShare gets a share from any of registered shwap.Getters in cascading order.

func (*CascadeGetter) GetSharesByNamespace

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

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

type SingleEDSGetter

type SingleEDSGetter struct {
	EDS *rsmt2d.ExtendedDataSquare
}

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) GetShare

func (seg *SingleEDSGetter) GetShare(
	_ context.Context,
	header *header.ExtendedHeader,
	row, col int,
) (share.Share, error)

GetShare gets a share 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