Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

README.md

pipe Go Report Card GoDoc

small package for reading pipe data

Installation

go get -u github.com/yaronsumel/pipe

Sync Usage

Read is Sync Action to get all pipe data fits in the predifened size

	data,err := pipe.Read(pipe.Stdin,1024)
	if err!=nil{
		//do something with the error
	}

Async Usage

AyncRead will keep reading from the pipe and write it back to StdDataChannel. Don't forget to handle the errors.

	StdinChannel := make(pipe.StdDataChannel)
	go pipe.AsyncRead(pipe.Stdin, 1024, StdinChannel)
	for {
		select {
		case stdin := <-StdinChannel:
			if stdin.Err != nil {
				panic(stdin.Err)
			}
			fmt.Println(stdin.Data)
		}
	}

Working Example

get the command

go get -u github.com/yaronsumel/pipe/pipe-example

run it.pipe it.that's it.

pipe-example --write | pipe-example

About

small package for reading pipe data

Resources

License

Releases

No releases published

Languages

You can’t perform that action at this time.