tnetwork

package
v0.0.0-...-60c6a2d Latest Latest
Warning

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

Go to latest
Published: Jun 24, 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 MessageStream

type MessageStream struct {
	Read  func() ([]byte, error)
	Write func([]byte) error
	Close func() error
}

func NewMessageStream

func NewMessageStream(stream io.ReadWriteCloser) MessageStream

type NReader

type NReader struct {
	// contains filtered or unexported fields
}

func NewNReader

func NewNReader(r io.Reader) (n *NReader)

func (*NReader) Read

func (nreader *NReader) Read(n uint64) (bytes []byte, err error)

func (*NReader) ReadByte

func (n *NReader) ReadByte() (byte, error)

type NodeStream

type NodeStream struct {
	Read          func() (*xmlnode.XmlNode, error)
	Write         func(*xmlnode.XmlNode) error
	Close         func() error
	MessageStream func() MessageStream
}

func NewNodeStream

func NewNodeStream(s io.ReadWriteCloser) NodeStream

type Peer

type Peer struct {
	ID     peer.ID
	Stream NodeStream
}

func NewPeer

func NewPeer(s network.Stream) *Peer

Jump to

Keyboard shortcuts

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