exchange

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: MIT Imports: 5 Imported by: 2

README

go-ipfs-exchange-interface

DAOT Labs' fork of ipfs/go-ipfs-exchange-interface.

This fork add suports for IPLD channels.

standard-readme compliant GoDoc Build Status

go-ipfs-exchange-interface defines the IPFS exchange interface

Lead Maintainer

Nex

Table of Contents

Install

go-ipfs-exchange-interface works like a regular Go module:

> go get github.com/daotl/go-ipfs-exchange-interface

Usage

import "github.com/daotl/go-ipfs-exchange-interface"

Check the GoDoc documentation

Contribute

PRs accepted.

Small note: If editing the README, please conform to the standard-readme specification.

License

MIT

Copyright for portions of this fork are held by Protocol Labs, Inc. as part of the original go-ipfs-exchange-interface project. All other copyright for this fork are held by DAOT Labs. All rights reserved.

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 public block associated with a given key.
	GetBlock(context.Context, cid.Cid) (blocks.Block, error)
	// GetBlockFromChannel returns the block associated with a given key from
	// the specified IPLD channel.
	GetBlockFromChannel(context.Context, channel.Channel, cid.Cid) (blocks.Block, error)
	// GetBlocks returns an IPLD channel where the caller may receive public blocks
	// that correspond to the provided keys.
	GetBlocks(context.Context, []cid.Cid) (<-chan blocks.Block, error)
	// GetBlocksFromChannel returns an IPLD channel where the caller may receive blocks
	// that correspond to the provided keys form the specified IPLD channel.
	GetBlocksFromChannel(context.Context, channel.Channel, []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

	HasBlockInChannel(channel.Channel, 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) Fetcher
}

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