io

package module
v0.0.0-...-7447419 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: AGPL-3.0 Imports: 6 Imported by: 1

Documentation

Overview

io describes the Sandwich I/O interface. The I/O interface is used by the implementation to perform all i/o operation.

io describes the Sandwich I/O interface. The I/O interface is used by the implementation to perform all i/o operation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IO

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

IO is a Sandwich IO.

func NewIO

func NewIO(readWriter io.ReadWriter) *IO

NewIO creates a new IO from a io.ReadWriter

type Listener

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

Listener is a listener that accepts connections and returns IOs.

func NewListener

func NewListener(configuration *api.ListenerConfiguration) (*Listener, error)

NewListener creates a new Sandwich listener from a protobuf configuration.

func (*Listener) Accept

func (listener *Listener) Accept() (*OwnedIO, *swerrors.IOError)

Write implements the sandwich.IO interface for bufIO.

func (*Listener) Close

func (listener *Listener) Close()

func (*Listener) Listen

func (listener *Listener) Listen() *swerrors.IOError

Reads implements the sandwich.IO interface for bufIO.

type OwnedIO

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

OwnedIO is a Sandwich IO owned by Sandwich.

func IOTCPClient

func IOTCPClient(hostname string, port uint16) (*OwnedIO, *swerrors.IOError)

Creates a Sandwich owned TCP based IO Object.

func IOTurboClient

func IOTurboClient(udp_hostname string, udp_port uint16, tcp_hostname string, tcp_port uint16) (*OwnedIO, *swerrors.IOError)

Creates a Sandwich owned Turbo based IO Object.

func (*OwnedIO) Read

func (ownedIO *OwnedIO) Read(b []byte) (int, error)

Read implements io.Read.

func (*OwnedIO) Write

func (ownedIO *OwnedIO) Write(b []byte) (int, error)

Write implements io.Write.

Jump to

Keyboard shortcuts

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