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) GetShare(ctx context.Context, header *header.ExtendedHeader, row, col int) (share.Share, error)
- func (cg *CascadeGetter) GetSharesByNamespace(ctx context.Context, header *header.ExtendedHeader, namespace share.Namespace) (shwap.NamespaceData, error)
- type SingleEDSGetter
- func (seg *SingleEDSGetter) GetEDS(_ context.Context, header *header.ExtendedHeader) (*rsmt2d.ExtendedDataSquare, error)
- func (seg *SingleEDSGetter) GetShare(_ context.Context, header *header.ExtendedHeader, row, col int) (share.Share, error)
- func (seg *SingleEDSGetter) GetSharesByNamespace(context.Context, *header.ExtendedHeader, share.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) 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 ¶
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) 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 ¶
func (seg *SingleEDSGetter) GetSharesByNamespace(context.Context, *header.ExtendedHeader, share.Namespace, ) (shwap.NamespaceData, error)
GetSharesByNamespace returns NamespacedShares from a kept EDS if the correct root is given.