transport

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FramedStream

type FramedStream struct {
	Trans Transport
	// contains filtered or unexported fields
}

FramedStream represents a stream with message semantics

func NewFramedStreamFromTransport

func NewFramedStreamFromTransport(t Transport) *FramedStream

NewFramedStreamFromTransport creates a message stream from transport t

func (*FramedStream) Close

func (fs *FramedStream) Close() error

Close closes the transport stream

func (*FramedStream) ReadMsg

func (fs *FramedStream) ReadMsg() ([]byte, error)

ReadMsg reads a io4edge standard message from transport stream

func (*FramedStream) WriteMsg

func (fs *FramedStream) WriteMsg(payload []byte) error

WriteMsg writes io4edge standard message to the transport stream

type MsgStream

type MsgStream interface {
	ReadMsg() (payload []byte, err error)
	WriteMsg(payload []byte) (err error)
	Close() error
}

MsgStream is the interface used by a Channel to exchange message frames with the transport layer e.g. socket, websocket...

type Transport

type Transport interface {
	Read(p []byte) (n int, err error)
	Write(p []byte) (n int, err error)
	Close() error
}

Transport is the interface used by message stream to communicate with the underlying transport layer e.g. socket, websocket...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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