net

package
v0.0.0-...-e081c89 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Net

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

Net Io interface

func NewDialer

func NewDialer(protocol, address string) (n *Net, err error)

NewDialer creates a new net.Dial-based stream.Io pipe

func NewListener

func NewListener(protocol, address string) (n *Net, err error)

NewListener creates a new net.Listen-based stream.Io pipe

func (*Net) Close

func (n *Net) Close()

Close net Io interface

func (*Net) DefaultDataType

func (n *Net) DefaultDataType(bool)

DefaultDataType is unavailable for net Io interfaces

func (*Net) File

func (n *Net) File() *os.File

func (*Net) ForceClose

func (n *Net) ForceClose()

ForceClose forces the net Io interface to close. This should only be called on reader interfaces

func (*Net) GetDataType

func (n *Net) GetDataType() string

GetDataType read the stream.Io interface's data type

func (*Net) IsTTY

func (n *Net) IsTTY() bool

IsTTY always returns false because net Io interfaces are not a pseudo-TTY

func (*Net) Open

func (n *Net) Open()

Open net Io interface

func (*Net) Read

func (n *Net) Read(p []byte) (i int, err error)

Read bytes from net Io interface

func (*Net) ReadAll

func (n *Net) ReadAll() (b []byte, err error)

ReadAll data from net Io interface

func (*Net) ReadArray

func (n *Net) ReadArray(ctx context.Context, callback func([]byte)) error

ReadArray treats net Io interface as an array of data

func (*Net) ReadArrayWithType

func (n *Net) ReadArrayWithType(ctx context.Context, callback func(interface{}, string)) error

ReadArrayWithType treats net Io interface as an array of data

func (*Net) ReadLine

func (n *Net) ReadLine(callback func([]byte)) error

ReadLine reads a line from net Io interface

func (*Net) ReadMap

func (n *Net) ReadMap(config *config.Config, callback func(*stdio.Map)) error

ReadMap treats net Io interface as an hash of data

func (*Net) SetDataType

func (n *Net) SetDataType(dt string)

SetDataType assigns a data type to the stream.Io interface

func (*Net) Stats

func (n *Net) Stats() (bytesWritten, bytesRead uint64)

Stats returns the bytes written and bytes read to the net Io interface

func (*Net) Write

func (n *Net) Write(b []byte) (i int, err error)

Write bytes to net Io interface

func (*Net) WriteArray

func (n *Net) WriteArray(dataType string) (stdio.ArrayWriter, error)

WriteArray performs data type specific buffered writes to an stdio.Io interface

func (*Net) WriteTo

func (n *Net) WriteTo(dst io.Writer) (i int64, err error)

WriteTo reads from net Io interface and then writes that to foreign Writer interface

func (*Net) Writeln

func (n *Net) Writeln(b []byte) (i int, err error)

Writeln writes a line to net Io interface

Jump to

Keyboard shortcuts

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