os

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2017 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 4 more Imports: 3 Imported by: 0

Documentation

Overview

Package os provides interfaces around the 'os', 'io', and 'ioutil' functions so that may be mocked out appropriately

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileSystem

type FileSystem interface {
	MkdirAll(path string, perm os.FileMode) error
	TempFile(dir, prefix string) (f *os.File, err error)
	Remove(path string)
	TeeReader(r io.Reader, w io.Writer) io.Reader
	Copy(dst io.Writer, src io.Reader) (written int64, err error)
	Rename(oldpath, newpath string) error
	ReadAll(r io.Reader) ([]byte, error)
	WriteFile(filename string, data []byte, perm os.FileMode) error
	Open(name string) (f io.ReadWriteCloser, err error)
	Create(name string) (f io.ReadWriteCloser, err error)
	Exit(code int)
}

FileSystem captures related functions from os, io, and io/ioutil packages

var Default FileSystem = &std{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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