Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var EOFTimeout = time.Second * 60
EOFTimeout is the maximum amount of time to wait to successfully observe an EOF on the stream. Defaults to 60 seconds.
var ErrExpectedEOF = errors.New("read data when expecting EOF")
ErrExpectedEOF is returned when we read data while expecting an EOF.
Functions ¶
func AwaitEOF ¶
AwaitEOF waits for an EOF on the given stream, returning an error if that fails. It waits at most EOFTimeout (defaults to 1 minute) after which it resets the stream.
func FullClose ¶
FullClose closes the stream and waits to read an EOF from the other side.
* If it reads any data *before* the EOF, it resets the stream. * If it doesn't read an EOF within EOFTimeout, it resets the stream.
You'll likely want to invoke this as `go FullClose(stream)` to close the stream in the background.
func MultistreamSemverMatcher ¶
MultistreamSemverMatcher returns a matcher function for a given base protocol. The matcher function will return a boolean indicating whether a protocol ID matches the base protocol. A given protocol ID matches the base protocol if the IDs are the same and if the semantic version of the base protocol is the same or higher than that of the protocol ID provided. TODO
Types ¶
This section is empty.