bitswap

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitSwap

type BitSwap api.BitSwap

func (BitSwap) AddRef

func (bs BitSwap) AddRef() BitSwap

func (BitSwap) GetBlock

func (bs BitSwap) GetBlock(ctx context.Context, key cid.Cid) (blocks.Block, error)

GetBlocks attempts to resolve the block corresponding to the supplied CID. It relies on ctx to time-out or cancel. The block received by the client is transparently verified against the supplied key, and blocks.ErrWrongHash is returned if these do not match.

func (BitSwap) Release

func (bs BitSwap) Release()

type Exchange

type Exchange interface {
	GetBlock(context.Context, cid.Cid) (blocks.Block, error)
}

Exchange is the local peer's BitSwap exchange. It is wrapped by Server to provide the BitSwap capability over the network.

type Server

type Server struct {
	Exchange Exchange
}

func (Server) BitSwap

func (s Server) BitSwap() BitSwap

func (Server) Client

func (s Server) Client() capnp.Client

func (Server) GetBlock

func (s Server) GetBlock(ctx context.Context, call api.BitSwap_getBlock) error

Directories

Path Synopsis
Package test_bitswap is a generated GoMock package.
Package test_bitswap is a generated GoMock package.

Jump to

Keyboard shortcuts

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