Documentation ¶
Index ¶
- func TestGetter(t *testing.T) (shwap.Getter, *header.ExtendedHeader)
- type CascadeGetter
- func (cg *CascadeGetter) GetEDS(ctx context.Context, header *header.ExtendedHeader) (*rsmt2d.ExtendedDataSquare, error)
- func (cg *CascadeGetter) GetSamples(ctx context.Context, hdr *header.ExtendedHeader, indices []shwap.SampleIndex) ([]shwap.Sample, error)
- func (cg *CascadeGetter) GetSharesByNamespace(ctx context.Context, header *header.ExtendedHeader, ...) (shwap.NamespaceData, error)
- type SingleEDSGetter
- func (seg *SingleEDSGetter) GetEDS(_ context.Context, header *header.ExtendedHeader) (*rsmt2d.ExtendedDataSquare, error)
- func (seg *SingleEDSGetter) GetSamples(ctx context.Context, hdr *header.ExtendedHeader, indices []shwap.SampleIndex) ([]shwap.Sample, error)
- func (seg *SingleEDSGetter) GetSharesByNamespace(context.Context, *header.ExtendedHeader, libshare.Namespace) (shwap.NamespaceData, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestGetter ¶
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 ¶
func (cg *CascadeGetter) GetEDS( ctx context.Context, header *header.ExtendedHeader, ) (*rsmt2d.ExtendedDataSquare, error)
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 ¶
SingleEDSGetter contains a single EDS where data is retrieved from. Its primary use is testing, and GetSharesByNamespace is not supported.
func (*SingleEDSGetter) GetEDS ¶
func (seg *SingleEDSGetter) GetEDS( _ context.Context, header *header.ExtendedHeader, ) (*rsmt2d.ExtendedDataSquare, error)
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 ¶
func (seg *SingleEDSGetter) GetSharesByNamespace(context.Context, *header.ExtendedHeader, libshare.Namespace, ) (shwap.NamespaceData, error)
GetSharesByNamespace returns NamespacedShares from a kept EDS if the correct root is given.