chanio

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChanIO

type ChanIO struct {
	// Send channel is read by ChanIO and the data sent to Write/WriteFrom
	ToRead    chan []byte
	FromWrite chan []byte

	ID string
	// contains filtered or unexported fields
}

ChanIO represents a ChanIO that can io.Copy data to/from channels

func New

func New(ctx context.Context, toRead, fromWrite chan []byte, id string) *ChanIO

New returns a pointer to a ChanIO that uses supplied channels it is usually the case the channels will already exist, e.g. from a reconws instance

func (*ChanIO) Read

func (c *ChanIO) Read(p []byte) (n int, err error)

func (*ChanIO) Write

func (c *ChanIO) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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