Documentation
¶
Index ¶
Constants ¶
const DefaultMaxGap = 64
DefaultMaxGap is the default maximum gap (in bytes) between blocks that can still be coalesced into a single request. This value accommodates the typical overhead between adjacent blocks in a CAR file, which consists of a varint length prefix (1-10 bytes) and a CID (34-37 bytes for CIDv0/CIDv1 with SHA2-256).
Variables ¶
This section is empty.
Functions ¶
func NewDAGService ¶
func NewDAGService(locator locator.Locator, retriever Retriever, spaces []did.DID, opts ...ExchangeOption) ipldfmt.DAGService
func NewExchange ¶
func NewExchange(locator locator.Locator, retriever Retriever, spaces []did.DID, opts ...ExchangeOption) exchange.Interface
NewExchange creates a new exchange for retrieving blocks from Storacha.
Types ¶
type ExchangeOption ¶ added in v0.4.0
type ExchangeOption func(*storachaExchange)
ExchangeOption configures a storachaExchange.
func WithMaxGap ¶ added in v0.4.0
func WithMaxGap(maxGap uint64) ExchangeOption
WithMaxGap sets the maximum gap (in bytes) between blocks that can still be coalesced into a single request. A maxGap of 0 means blocks must be exactly contiguous to be coalesced. The default is DefaultMaxGap.
type Retriever ¶
type Retriever interface {
Retrieve(ctx context.Context, location locator.Location) (io.ReadCloser, error)
}
Retriever can fetch content from a given locator.Location. `Retrieve` does no data validation.