xpipe

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrError   = errors.New("")
	ErrOpen    = fmt.Errorf("%wopen pipe failed", ErrError)
	ErrClosed  = fmt.Errorf("%wpipe closed", ErrError)
	ErrBreak   = fmt.Errorf("%woperation break", ErrError)
	ErrTimeout = fmt.Errorf("%woperation timeout", ErrError)
	ErrRead    = fmt.Errorf("%wread pipe failed", ErrError)
	ErrWrite   = fmt.Errorf("%wwrite pipe failed", ErrError)
)

Functions

This section is empty.

Types

type Pipe

type Pipe struct {

	// read/write polling params
	PollInterval  float64
	PollChunkSize int
	PollMaxSize   int
	// contains filtered or unexported fields
}

func NewPipe

func NewPipe(path string) *Pipe

func (*Pipe) Cancel

func (p *Pipe) Cancel()

cancel active read/write operation on pipe

func (*Pipe) Close

func (p *Pipe) Close()

close file connection handler on pipe

func (*Pipe) Create

func (p *Pipe) Create(perm uint32) error

create new pipe dev-file on system, removes previous file if exist

func (*Pipe) Delete

func (p *Pipe) Delete() error

removes pipe dev-file from system

func (*Pipe) Open

func (p *Pipe) Open(mode int) error

open file connection handler on pipe

func (*Pipe) OpenRead

func (p *Pipe) OpenRead() error

open pipe for reading in non-blocking mode

func (*Pipe) OpenWrite

func (p *Pipe) OpenWrite() error

open pipe for writing in non-blocking mode

func (*Pipe) Read

func (p *Pipe) Read() ([]byte, error)

read from pipe

func (*Pipe) ReadWait

func (p *Pipe) ReadWait(timeout float64) ([]byte, error)

read from pipe, until data is received or timeout. use timeout=0 to wait forever (blocking mode)

func (*Pipe) Write

func (p *Pipe) Write(data []byte) error

write to pipe

func (*Pipe) WriteWait

func (p *Pipe) WriteWait(data []byte, timeout float64) error

write to pipe, wait until peer is connected use timeout=0 to wait forever (blocking mode)

Jump to

Keyboard shortcuts

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