file

package
v1.1.1-0...-acba925 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(src, dst string) (int64, error)

Copy copies a file from src to dst. It returns the number of bytes copied and/or an error.

func Reader2File

func Reader2File(rdr io.Reader, dst string) (written int64, err error)

Types

type AtomicWrite

type AtomicWrite struct {
	// contains filtered or unexported fields
}

AtomicWrite atomically writes files by using a temp file. When Close is called the temp file is closed and moved to its final destination.

func NewAtomicWrite

func NewAtomicWrite(dst string) *AtomicWrite

func (*AtomicWrite) Close

func (a *AtomicWrite) Close() error

Close closes the temporary file and moves to the destination

func (*AtomicWrite) Copy

func (a *AtomicWrite) Copy(rdr io.Reader) (written int64, err error)

Copy Reads until EOF or an error occurs. Data is written to the tempfile

func (*AtomicWrite) Write

func (a *AtomicWrite) Write(data []byte) (written int, err error)

Write writes bytes to the tempfile

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL