io

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT, MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBidirectionalChannel

func CreateBidirectionalChannel() (FileChannel, FileChannel, error)

CreateBidirectionalChannel creates a pair of FileChannels that are connected to each other.

Types

type FileChannel

type FileChannel interface {
	io.ReadWriteCloser
	// Reader returns the file that is used for reading.
	Reader() *os.File
	// Writer returns the file that is used for writing.
	Writer() *os.File
}

FileChannel is a unidirectional channel for file I/O

type ReadWritePair

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

func NewReadWritePair

func NewReadWritePair(r *os.File, w *os.File) *ReadWritePair

NewReadWritePair creates a new FileChannel that uses the given files

func (*ReadWritePair) Close

func (rw *ReadWritePair) Close() error

func (*ReadWritePair) Read

func (rw *ReadWritePair) Read(p []byte) (int, error)

func (*ReadWritePair) Reader

func (rw *ReadWritePair) Reader() *os.File

func (*ReadWritePair) Write

func (rw *ReadWritePair) Write(p []byte) (int, error)

func (*ReadWritePair) Writer

func (rw *ReadWritePair) Writer() *os.File

Jump to

Keyboard shortcuts

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