diff options
author | Ian Lewis <ianlewis@google.com> | 2018-12-04 04:55:39 -0500 |
---|---|---|
committer | Ian Lewis <ianlewis@google.com> | 2018-12-04 04:55:39 -0500 |
commit | ae2250b1dd07fcdb6a2212022b75d63d26966499 (patch) | |
tree | 7c155cffdcf66ea800a0d812dee11b9a6044eabd /vendor/github.com/containerd/fifo/readme.md |
Initial commit
Diffstat (limited to 'vendor/github.com/containerd/fifo/readme.md')
-rw-r--r-- | vendor/github.com/containerd/fifo/readme.md | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/vendor/github.com/containerd/fifo/readme.md b/vendor/github.com/containerd/fifo/readme.md new file mode 100644 index 000000000..2b41b3b1c --- /dev/null +++ b/vendor/github.com/containerd/fifo/readme.md @@ -0,0 +1,32 @@ +### fifo + +[![Build Status](https://travis-ci.org/containerd/fifo.svg?branch=master)](https://travis-ci.org/containerd/fifo) + +Go package for handling fifos in a sane way. + +``` +// OpenFifo opens a fifo. Returns io.ReadWriteCloser. +// Context can be used to cancel this function until open(2) has not returned. +// Accepted flags: +// - syscall.O_CREAT - create new fifo if one doesn't exist +// - syscall.O_RDONLY - open fifo only from reader side +// - syscall.O_WRONLY - open fifo only from writer side +// - syscall.O_RDWR - open fifo from both sides, never block on syscall level +// - syscall.O_NONBLOCK - return io.ReadWriteCloser even if other side of the +// fifo isn't open. read/write will be connected after the actual fifo is +// open or after fifo is closed. +func OpenFifo(ctx context.Context, fn string, flag int, perm os.FileMode) (io.ReadWriteCloser, error) + + +// Read from a fifo to a byte array. +func (f *fifo) Read(b []byte) (int, error) + + +// Write from byte array to a fifo. +func (f *fifo) Write(b []byte) (int, error) + + +// Close the fifo. Next reads/writes will error. This method can also be used +// before open(2) has returned and fifo was never opened. +func (f *fifo) Close() error +``` |