pipe

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: MIT Imports: 5 Imported by: 0

README

XGo/Pipe

在 Go 里通过 pipe 调 C 的一个 demo

Run Examples
gcc ./examples/cpipe.c -o a.out

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecPipe

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

func NewExecPipe

func NewExecPipe(cmd *exec.Cmd) *ExecPipe

func (*ExecPipe) Start

func (this *ExecPipe) Start() (err error)

func (*ExecPipe) Stop

func (this *ExecPipe) Stop() error

func (*ExecPipe) WriteAndRead

func (this *ExecPipe) WriteAndRead(b []byte) (resp []byte, err error)

type Pipe

type Pipe interface {
	Start() error
	Stop() error
	WriteAndRead([]byte) ([]byte, error)
}

type Pipes

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

func NewPipes

func NewPipes(pipes []Pipe) *Pipes

func (*Pipes) AcquirePipe

func (this *Pipes) AcquirePipe() Pipe

func (*Pipes) ReleasePipe

func (this *Pipes) ReleasePipe(p Pipe)

func (*Pipes) Start

func (this *Pipes) Start() (err error)

func (*Pipes) Stop

func (this *Pipes) Stop() (err error)

func (*Pipes) WriteAndRead

func (this *Pipes) WriteAndRead(b []byte) (resp []byte, err error)

Jump to

Keyboard shortcuts

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