blockbroker

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: Apache-2.0, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockSession

type BlockSession interface {
	Get(ctx context.Context, c cid.Cid) (blocks.Block, error)
	GetSubgraph(ctx context.Context, c cid.Cid, lsys linking.LinkSystem) (int, error)
	SeedProviders(ctx context.Context, c cid.Cid)
	Close() error
}

BlockSession manages per-block fetching with provider caching.

type TrustlessGatewaySession

type TrustlessGatewaySession struct {
	// contains filtered or unexported fields
}

TrustlessGatewaySession implements BlockSession using HTTP trustless gateways. It maintains a cache of providers discovered during block fetching and performs per-block provider discovery when needed.

func NewSession

func NewSession(
	routing types.CandidateSource,
	httpClient *http.Client,
) *TrustlessGatewaySession

NewSession creates a new TrustlessGatewaySession for per-block HTTP fetching.

func (*TrustlessGatewaySession) Close

func (s *TrustlessGatewaySession) Close() error

func (*TrustlessGatewaySession) Get

func (*TrustlessGatewaySession) GetSubgraph

func (s *TrustlessGatewaySession) GetSubgraph(ctx context.Context, c cid.Cid, lsys linking.LinkSystem) (int, error)

GetSubgraph fetches a subgraph as CAR. Tries providers sequentially (CAR is expensive).

func (*TrustlessGatewaySession) SeedProviders

func (s *TrustlessGatewaySession) SeedProviders(ctx context.Context, c cid.Cid)

Jump to

Keyboard shortcuts

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