getter

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: AGPL-3.0 Imports: 7 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, wants []auth.Want, notif notifications.PubSub,
	want WantFunc, cwants func([]cid.Cid)) (<-chan auth.AuthBlock, 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, w auth.Want, gb GetBlocksFunc) (auth.AuthBlock, 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 syncronously.

Types

type GetBlocksFunc

type GetBlocksFunc func(context.Context, []auth.Want) (<-chan auth.AuthBlock, 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, []auth.Want)

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