dagservice

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0, MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL