package ioutil
import "github.com/containerd/cri/pkg/ioutil"
Index ¶
- func NewNopWriteCloser(w io.Writer) io.WriteCloser
- func NewWriteCloseInformer(wc io.WriteCloser) (io.WriteCloser, <-chan struct{})
- type WriterGroup
Functions ¶
func NewNopWriteCloser ¶
func NewNopWriteCloser(w io.Writer) io.WriteCloser
NewNopWriteCloser creates the nopWriteCloser from a writer.
func NewWriteCloseInformer ¶
func NewWriteCloseInformer(wc io.WriteCloser) (io.WriteCloser, <-chan struct{})
NewWriteCloseInformer creates the writeCloseInformer from a write closer.
Types ¶
type WriterGroup ¶
type WriterGroup struct {
// contains filtered or unexported fields
}
WriterGroup is a group of writers. Writer could be dynamically added and removed.
func NewWriterGroup ¶
func NewWriterGroup() *WriterGroup
NewWriterGroup creates an empty writer group.
func (*WriterGroup) Add ¶
func (g *WriterGroup) Add(key string, w io.WriteCloser) error
Add adds a writer into the group, returns an error when writer group is closed.
func (*WriterGroup) Close ¶
func (g *WriterGroup) Close()
Close closes the writer group. Write or Add will return error after closed.
func (*WriterGroup) Remove ¶
func (g *WriterGroup) Remove(key string)
Remove removes a writer from the group.
func (*WriterGroup) Write ¶
func (g *WriterGroup) Write(p []byte) (int, error)
Write writes data into each writer. If a writer returns error, it will be closed and removed from the writer group. It returns error if writer group is empty.
Source Files ¶
write_closer.go writer_group.go
- Version
- v1.0.0-alpha.1
- Published
- Oct 31, 2017
- Platform
- js/wasm
- Imports
- 4 packages
- Last checked
- 4 hours ago –
Tools for package owners.