getter

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0, MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsyncGetBlocks

func AsyncGetBlocks(ctx context.Context, sessctx context.Context, keys []cid.Cid, notif notifications.PubSub,
	want WantFunc, cwants func([]cid.Cid),
) (<-chan blocks.Block, error)

AsyncGetBlocks take a set of block cids, a pubsub channel for incoming blocks, a want function, and a close function, and returns a channel of incoming blocks.

func SyncGetBlock

func SyncGetBlock(p context.Context, k cid.Cid, gb GetBlocksFunc) (blocks.Block, error)

SyncGetBlock takes a block cid and an async function for getting several blocks that returns a channel, and uses that function to return the block synchronously.

Types

type GetBlocksFunc

type GetBlocksFunc func(context.Context, []cid.Cid) (<-chan blocks.Block, error)

GetBlocksFunc is any function that can take an array of CIDs and return a channel of incoming blocks.

type WantFunc

type WantFunc func(context.Context, []cid.Cid)

WantFunc is any function that can express a want for set of blocks.

Jump to

Keyboard shortcuts

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