stream

package
v0.0.0-...-84dde57 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stream

type Stream interface {
	Send(context.Context, peer.ID, []byte) error
	Close() error
}

stream is an interface for sending messages over a network stream

func New

func New(
	host host.Host,
	proto protocol.ID,
	handler func(stream network.Stream),
) Stream

it creates a new Stream instance and sets the StreamHandler

Jump to

Keyboard shortcuts

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