Documentation ¶
Index ¶
- func ErrorContains(err, target error) bool
- func TestGetter(t *testing.T) (share.Getter, *share.Root)
- func WithSession(ctx context.Context) context.Context
- type CascadeGetter
- func (cg *CascadeGetter) GetEDS(ctx context.Context, root *share.Root) (*rsmt2d.ExtendedDataSquare, error)
- func (cg *CascadeGetter) GetShare(ctx context.Context, root *share.Root, row, col int) (share.Share, error)
- func (cg *CascadeGetter) GetSharesByNamespace(ctx context.Context, root *share.Root, namespace share.Namespace) (share.NamespacedShares, error)
- type IPLDGetter
- func (ig *IPLDGetter) GetEDS(ctx context.Context, root *share.Root) (eds *rsmt2d.ExtendedDataSquare, err error)
- func (ig *IPLDGetter) GetShare(ctx context.Context, dah *share.Root, row, col int) (share.Share, error)
- func (ig *IPLDGetter) GetSharesByNamespace(ctx context.Context, root *share.Root, namespace share.Namespace) (shares share.NamespacedShares, err error)
- type ShrexGetter
- func (sg *ShrexGetter) GetEDS(ctx context.Context, root *share.Root) (*rsmt2d.ExtendedDataSquare, error)
- func (sg *ShrexGetter) GetShare(context.Context, *share.Root, int, int) (share.Share, error)
- func (sg *ShrexGetter) GetSharesByNamespace(ctx context.Context, root *share.Root, namespace share.Namespace) (share.NamespacedShares, error)
- func (sg *ShrexGetter) Start(ctx context.Context) error
- func (sg *ShrexGetter) Stop(ctx context.Context) error
- func (sg *ShrexGetter) WithMetrics() error
- type SingleEDSGetter
- func (seg *SingleEDSGetter) GetEDS(_ context.Context, root *share.Root) (*rsmt2d.ExtendedDataSquare, error)
- func (seg *SingleEDSGetter) GetShare(_ context.Context, root *share.Root, row, col int) (share.Share, error)
- func (seg *SingleEDSGetter) GetSharesByNamespace(context.Context, *share.Root, share.Namespace) (share.NamespacedShares, error)
- type StoreGetter
- func (sg *StoreGetter) GetEDS(ctx context.Context, root *share.Root) (data *rsmt2d.ExtendedDataSquare, err error)
- func (sg *StoreGetter) GetShare(ctx context.Context, dah *share.Root, row, col int) (share.Share, error)
- func (sg *StoreGetter) GetSharesByNamespace(ctx context.Context, root *share.Root, namespace share.Namespace) (shares share.NamespacedShares, err error)
- type TeeGetter
- func (tg *TeeGetter) GetEDS(ctx context.Context, root *share.Root) (eds *rsmt2d.ExtendedDataSquare, err error)
- func (tg *TeeGetter) GetShare(ctx context.Context, root *share.Root, row, col int) (share share.Share, err error)
- func (tg *TeeGetter) GetSharesByNamespace(ctx context.Context, root *share.Root, namespace share.Namespace) (shares share.NamespacedShares, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorContains ¶ added in v0.7.0
ErrorContains reports whether any error in err's tree matches any error in targets tree.
func TestGetter ¶ added in v0.6.3
TestGetter provides a testing SingleEDSGetter and the root of the EDS it holds.
Types ¶
type CascadeGetter ¶ added in v0.6.3
type CascadeGetter struct {
// contains filtered or unexported fields
}
CascadeGetter implements custom share.Getter that composes multiple Getter implementations in "cascading" order.
See cascade func for details on cascading.
func NewCascadeGetter ¶ added in v0.6.3
func NewCascadeGetter(getters []share.Getter) *CascadeGetter
NewCascadeGetter instantiates a new CascadeGetter from given share.Getters with given interval.
func (*CascadeGetter) GetEDS ¶ added in v0.6.3
func (cg *CascadeGetter) GetEDS(ctx context.Context, root *share.Root) (*rsmt2d.ExtendedDataSquare, error)
GetEDS gets a full EDS from any of registered share.Getters in cascading order.
func (*CascadeGetter) GetShare ¶ added in v0.6.3
func (cg *CascadeGetter) GetShare(ctx context.Context, root *share.Root, row, col int) (share.Share, error)
GetShare gets a share from any of registered share.Getters in cascading order.
func (*CascadeGetter) GetSharesByNamespace ¶ added in v0.6.3
func (cg *CascadeGetter) GetSharesByNamespace( ctx context.Context, root *share.Root, namespace share.Namespace, ) (share.NamespacedShares, error)
GetSharesByNamespace gets NamespacedShares from any of registered share.Getters in cascading order.
type IPLDGetter ¶
type IPLDGetter struct {
// contains filtered or unexported fields
}
IPLDGetter is a share.Getter that retrieves shares from the bitswap network. Result caching is handled by the provided blockservice. A blockservice session will be created for retrieval if the passed context is wrapped with WithSession.
func NewIPLDGetter ¶
func NewIPLDGetter(bServ blockservice.BlockService) *IPLDGetter
NewIPLDGetter creates a new share.Getter that retrieves shares from the bitswap network.
func (*IPLDGetter) GetEDS ¶
func (ig *IPLDGetter) GetEDS(ctx context.Context, root *share.Root) (eds *rsmt2d.ExtendedDataSquare, err error)
func (*IPLDGetter) GetShare ¶
func (ig *IPLDGetter) GetShare(ctx context.Context, dah *share.Root, row, col int) (share.Share, error)
GetShare gets a single share at the given EDS coordinates from the bitswap network.
func (*IPLDGetter) GetSharesByNamespace ¶
func (ig *IPLDGetter) GetSharesByNamespace( ctx context.Context, root *share.Root, namespace share.Namespace, ) (shares share.NamespacedShares, err error)
type ShrexGetter ¶ added in v0.7.0
type ShrexGetter struct {
// contains filtered or unexported fields
}
ShrexGetter is a share.Getter that uses the shrex/eds and shrex/nd protocol to retrieve shares.
func NewShrexGetter ¶ added in v0.7.0
func (*ShrexGetter) GetEDS ¶ added in v0.7.0
func (sg *ShrexGetter) GetEDS(ctx context.Context, root *share.Root) (*rsmt2d.ExtendedDataSquare, error)
func (*ShrexGetter) GetSharesByNamespace ¶ added in v0.7.0
func (sg *ShrexGetter) GetSharesByNamespace( ctx context.Context, root *share.Root, namespace share.Namespace, ) (share.NamespacedShares, error)
func (*ShrexGetter) WithMetrics ¶ added in v0.9.2
func (sg *ShrexGetter) WithMetrics() error
type SingleEDSGetter ¶ added in v0.6.3
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 ¶ added in v0.6.3
func (seg *SingleEDSGetter) GetEDS(_ context.Context, root *share.Root) (*rsmt2d.ExtendedDataSquare, error)
GetEDS returns a kept EDS if the correct root is given.
func (*SingleEDSGetter) GetShare ¶ added in v0.6.3
func (seg *SingleEDSGetter) GetShare(_ context.Context, root *share.Root, 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 ¶ added in v0.6.3
func (seg *SingleEDSGetter) GetSharesByNamespace(context.Context, *share.Root, share.Namespace, ) (share.NamespacedShares, error)
GetSharesByNamespace returns NamespacedShares from a kept EDS if the correct root is given.
type StoreGetter ¶
type StoreGetter struct {
// contains filtered or unexported fields
}
StoreGetter is a share.Getter that retrieves shares from an eds.Store. No results are saved to the eds.Store after retrieval.
func NewStoreGetter ¶
func NewStoreGetter(store *eds.Store) *StoreGetter
NewStoreGetter creates a new share.Getter that retrieves shares from an eds.Store.
func (*StoreGetter) GetEDS ¶
func (sg *StoreGetter) GetEDS(ctx context.Context, root *share.Root) (data *rsmt2d.ExtendedDataSquare, err error)
GetEDS gets the EDS identified by the given root from the EDS store.
func (*StoreGetter) GetShare ¶
func (sg *StoreGetter) GetShare(ctx context.Context, dah *share.Root, row, col int) (share.Share, error)
GetShare gets a single share at the given EDS coordinates from the eds.Store through the corresponding CAR-level blockstore.
func (*StoreGetter) GetSharesByNamespace ¶
func (sg *StoreGetter) GetSharesByNamespace( ctx context.Context, root *share.Root, namespace share.Namespace, ) (shares share.NamespacedShares, err error)
GetSharesByNamespace gets all EDS shares in the given namespace from the EDS store through the corresponding CAR-level blockstore.