getter

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: Apache-2.0, MIT Imports: 8 Imported by: 0

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