exchange

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package exchange defines the IPFS exchange interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

type Fetcher interface {
	// GetBlock returns the block associated with a given key.
	GetBlock(context.Context, *cid.Cid) (blocks.Block, error)
	GetBlocks(context.Context, []*cid.Cid) (<-chan blocks.Block, error)
}

Fetcher is an object that can be used to retrieve blocks

type Interface

type Interface interface {
	Fetcher

	// TODO Should callers be concerned with whether the block was made
	// available on the network?
	HasBlock(blocks.Block) error

	IsOnline() bool

	io.Closer
}

Interface defines the functionality of the IPFS block exchange protocol.

type SessionExchange

type SessionExchange interface {
	Interface
	NewSession(context.Context) Interface
}

SessionExchange is an exchange.Interface which supports sessions.

Jump to

Keyboard shortcuts

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