package ioutil
import "github.com/coreos/etcd/pkg/ioutil"
Package ioutil implements I/O utility functions.
Index ¶
- Variables
- func NewExactReadCloser(rc io.ReadCloser, totalBytes int64) io.ReadCloser
- func NewLimitedBufferReader(r io.Reader, n int) io.Reader
- func WriteAndSyncFile(filename string, data []byte, perm os.FileMode) error
- type ReaderAndCloser
Variables ¶
var ( ErrShortRead = fmt.Errorf("ioutil: short read") ErrExpectEOF = fmt.Errorf("ioutil: expect EOF") )
Functions ¶
func NewExactReadCloser ¶
func NewExactReadCloser(rc io.ReadCloser, totalBytes int64) io.ReadCloser
NewExactReadCloser returns a ReadCloser that returns errors if the underlying reader does not read back exactly the requested number of bytes.
func NewLimitedBufferReader ¶
NewLimitedBufferReader returns a reader that reads from the given reader but limits the amount of data returned to at most n bytes.
func WriteAndSyncFile ¶
WriteAndSyncFile behaves just like ioutil.WriteFile in the standard library, but calls Sync before closing the file. WriteAndSyncFile guarantees the data is synced if there is no error returned.
Types ¶
type ReaderAndCloser ¶
ReaderAndCloser implements io.ReadCloser interface by combining reader and closer together.
Source Files ¶
readcloser.go reader.go util.go
- Version
- v3.0.1+incompatible
- Published
- Jul 1, 2016
- Platform
- js/wasm
- Imports
- 4 packages
- Last checked
- 16 minutes ago –
Tools for package owners.