stream

package
v0.23.2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenOpts

type OpenOpts struct {
	// Encrypted indicates the stream MUST be encrypted.
	// An error is returned if the stream cannot be encrypted.
	Encrypted bool
	// Reliable indicates the stream MUST be reliable / ordered.
	// An error is returned if the stream cannot be reliable.
	Reliable bool
}

OpenOpts are optional arguments when opening a stream.

type Stream

type Stream interface {
	// Read data from the stream.
	Read(b []byte) (n int, err error)
	// Write data to the stream.
	Write(b []byte) (n int, err error)
	// SetReadDeadline sets the read deadline as defined by
	// A zero time value disables the deadline.
	SetReadDeadline(t time.Time) error
	// SetWriteDeadline sets the write deadline as defined by
	// A zero time value disables the deadline.
	SetWriteDeadline(t time.Time) error
	// SetDeadline sets both read and write deadlines as defined by
	// A zero time value disables the deadlines.
	SetDeadline(t time.Time) error
	// Close closes the stream.
	Close() error
}

Stream is a stream-based data channel between two peers over a link.

Directories

Path Synopsis
api
rpc
e2e
e2e

Jump to

Keyboard shortcuts

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