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 cid. GetBlock(context.Context, cid.Cid) (blocks.Block, error) // GetBlocks returns the blocks associated with the given cids. // If the requested blocks are not found immediately, this function should hang until // they are found. If they can't be found later, it's also acceptable to terminate. 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 // NotifyNewBlocks tells the exchange that new blocks are available and can be served. NotifyNewBlocks(ctx context.Context, blocks ...blocks.Block) error io.Closer }
Interface defines the functionality of the IPFS block exchange protocol.
type SessionExchange ¶
type SessionExchange interface { Interface // NewSession generates a new exchange session. You should use this, rather // that calling GetBlocks, any time you intend to do several related calls // in a row. The exchange can leverage that to be more efficient. NewSession(context.Context) Fetcher }
SessionExchange is an exchange.Interface which supports sessions.
Directories ¶
Path | Synopsis |
---|---|
package offline implements an object that implements the exchange interface but returns nil values to every request.
|
package offline implements an object that implements the exchange interface but returns nil values to every request. |
Package providing implements an exchange wrapper which does content providing for new blocks.
|
Package providing implements an exchange wrapper which does content providing for new blocks. |
Click to show internal directories.
Click to hide internal directories.