package
0.17.0
Repository: https://github.com/ipfs/go-graphsync.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

AssertChannelEmpty verifies that a channel has no value currently.
AssertContainsBlock will fail a test if the block is not in the given block list.
AssertContainsPeer will fail a test if the peer is not in the given peer list.
AssertDoesReceive verifies that a channel returns some value before the given context closes.
AssertDoesReceiveFirst asserts that the given channel receives a value before any of the other channels specified.
AssertReceive verifies that a channel returns a value before the given context closes, and writes into into out, which should be a pointer to the value type.
AssertReceiveFirst verifies that a channel returns a value on the specified channel before the other channels, and writes the value into out, which should be a pointer to the value type.
AssertSends attempts to send the given input value to the given channel before the given context closes.
AttributeValueInTraceSpan is a test helper that asserts that at a span contains an attribute with the name provided, and returns the value of that attribute for further inspection.
CollectErrors is just a utility to convert an error channel into an array.
CollectResponses is just a utility to convert a graphsync response progress channel into an array.
ContainsBlock returns true if a block is found n a list of blocks.
ContainsPeer returns true if a peer is found n a list of peers.
EventAsException is a test helper that converts a trace event to an ExceptionEvent for easier inspection.
EventInTraceSpan is a test helper that asserts that at a span contains an event with the name provided, and returns the value of that event for further inspection.
GenerateBlocksOfSize generates a series of blocks of the given byte size.
GenerateCids produces n content identifiers.
GeneratePeers creates n peer ids.
IndexOf returns the index of a given cid in an array of blocks.
NewFakeBlockData returns a fake block that matches the block data interface.
NewInvalidSelectorSpec returns a spec that will fail when you attempt to validate it on the responder side.
No description provided by the author
NewTestConnManager returns a new TestConnManager.
NewTestIPLDTree returns a fake tree of nodes, spread across 5 blocks.
NewTestLink returns a randomly generated IPLD Link.
NewTestStore provides a loader and storer for the given in memory link -> byte data map.
No description provided by the author
NewUnparsableSelectorSpec returns a spec that will fail when you attempt to validate it or decompose to a node + selector.
RandomBytes returns a byte array of the given size with random values.
ReadNResponses does a partial read from a ResponseProgress channel -- up to n values.
RefuteContainsBlock will fail a test if the block is in the given block list.
RefuteContainsPeer will fail a test if the peer is in the given peer list.
No description provided by the author
SetupBlockChain creates a new test block chain with the given height.
No description provided by the author
SetupTracing returns a test helper that can will collect all spans within a Collector.
VerifyEmptyErrors verifies that no errors were sent over a channel before it was closed.
VerifyEmptyResponse verifies that no response progress happened before the channel was closed.
VerifyHasErrors verifies that at least one error was sent over a channel.
VerifySingleTerminalError verifies that exactly one error was sent over a channel and then the channel was closed.

# Structs

Collector can be used as a trace batcher to provide traces to, we collect individual spans and then extract useful data out of them for test assertions.
No description provided by the author
ExceptionEvent is a simplistic string form representation of an event.
No description provided by the author
TestBlockChain is a simulated data structure similar to a blockchain which graphsync is uniquely suited for.
TestConnManager implements network.ConnManager and allows you to assert behavior.
No description provided by the author
TestIPLDTree is a set of IPLD Data that forms a tree spread across some blocks with a serialized in memory representation.
No description provided by the author