package
17.12.1-ce-rc2+incompatible
Repository: https://github.com/mirantis/cli.git
Documentation: pkg.go.dev
# Functions
AtomicWriteFile atomically writes data to a file named by filename.
HashData returns the sha256 sum of src.
NewAtomicFileWriter returns WriteCloser so that writing to it writes to a temporary file and closing it atomically changes the temporary file to destination path.
NewAtomicWriteSet creates a new atomic write set to atomically create a set of files.
NewBytesPipe creates new BytesPipe, initialized by specified slice.
NewCancelReadCloser creates a wrapper that closes the ReadCloser when the context is cancelled.
NewReadCloserWrapper returns a new io.ReadCloser.
NewReaderErrWrapper returns a new io.Reader.
NewWriteCloserWrapper returns a new io.WriteCloser.
NewWriteCounter returns a new WriteCounter.
NewWriteFlusher returns a new WriteFlusher.
NopWriteCloser returns a nopWriteCloser.
TempDir on Unix systems is equivalent to ioutil.TempDir.
# Variables
ErrClosed is returned when Write is called on a closed BytesPipe.
# Structs
AtomicWriteSet is used to atomically write a set of files and ensure they are visible at the same time.
BytesPipe is io.ReadWriteCloser which works similarly to pipe(queue).
NopFlusher represents a type which flush operation is nop.
NopWriter represents a type which write operation is nop.
OnEOFReader wraps an io.ReadCloser and a function the function will run at the end of file or close the file.
WriteCounter wraps a concrete io.Writer and hold a count of the number of bytes written to the writer during a "session".
WriteFlusher wraps the Write and Flush operation ensuring that every write is a flush.