iioutil

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fake

type Fake struct {
	ReadAllStub func(io.Reader) ([]byte, error)

	ReadDirStub func(string) ([]os.FileInfo, error)

	ReadFileStub func(string) ([]byte, error)

	TempDirStub func(string, string) (string, error)

	TempFileStub func(string, string) (*os.File, error)

	WriteFileStub func(string, []byte, os.FileMode) error
	// contains filtered or unexported fields
}

Fake ...

func NewFake

func NewFake() *Fake

NewFake is the preferred way to initialise a Fake

func (*Fake) Invocations

func (fake *Fake) Invocations() map[string][][]interface{}

Invocations ...

func (*Fake) ReadAll

func (fake *Fake) ReadAll(arg1 io.Reader) ([]byte, error)

ReadAll ...

func (*Fake) ReadAllArgsForCall

func (fake *Fake) ReadAllArgsForCall(i int) io.Reader

ReadAllArgsForCall ...

func (*Fake) ReadAllCallCount

func (fake *Fake) ReadAllCallCount() int

ReadAllCallCount ...

func (*Fake) ReadAllReturns

func (fake *Fake) ReadAllReturns(result1 []byte, result2 error)

ReadAllReturns ...

func (*Fake) ReadDir

func (fake *Fake) ReadDir(arg1 string) ([]os.FileInfo, error)

ReadDir ...

func (*Fake) ReadDirArgsForCall

func (fake *Fake) ReadDirArgsForCall(i int) string

ReadDirArgsForCall ...

func (*Fake) ReadDirCallCount

func (fake *Fake) ReadDirCallCount() int

ReadDirCallCount ...

func (*Fake) ReadDirReturns

func (fake *Fake) ReadDirReturns(result1 []os.FileInfo, result2 error)

ReadDirReturns ...

func (*Fake) ReadFile

func (fake *Fake) ReadFile(arg1 string) ([]byte, error)

ReadFile ...

func (*Fake) ReadFileArgsForCall

func (fake *Fake) ReadFileArgsForCall(i int) string

ReadFileArgsForCall ...

func (*Fake) ReadFileCallCount

func (fake *Fake) ReadFileCallCount() int

ReadFileCallCount ...

func (*Fake) ReadFileReturns

func (fake *Fake) ReadFileReturns(result1 []byte, result2 error)

ReadFileReturns ...

func (*Fake) TempDir

func (fake *Fake) TempDir(arg1 string, arg2 string) (string, error)

TempDir ...

func (*Fake) TempDirArgsForCall

func (fake *Fake) TempDirArgsForCall(i int) (string, string)

TempDirArgsForCall ...

func (*Fake) TempDirCallCount

func (fake *Fake) TempDirCallCount() int

TempDirCallCount ...

func (*Fake) TempDirReturns

func (fake *Fake) TempDirReturns(result1 string, result2 error)

TempDirReturns ...

func (*Fake) TempFile

func (fake *Fake) TempFile(arg1 string, arg2 string) (*os.File, error)

TempFile ...

func (*Fake) TempFileArgsForCall

func (fake *Fake) TempFileArgsForCall(i int) (string, string)

TempFileArgsForCall ...

func (*Fake) TempFileCallCount

func (fake *Fake) TempFileCallCount() int

TempFileCallCount ...

func (*Fake) TempFileReturns

func (fake *Fake) TempFileReturns(result1 *os.File, result2 error)

TempFileReturns ...

func (*Fake) WriteFile

func (fake *Fake) WriteFile(arg1 string, arg2 []byte, arg3 os.FileMode) error

WriteFile ...

func (*Fake) WriteFileArgsForCall

func (fake *Fake) WriteFileArgsForCall(i int) (string, []byte, os.FileMode)

WriteFileArgsForCall ...

func (*Fake) WriteFileCallCount

func (fake *Fake) WriteFileCallCount() int

WriteFileCallCount ...

func (*Fake) WriteFileReturns

func (fake *Fake) WriteFileReturns(result1 error)

WriteFileReturns ...

type Ioutil

type Ioutil interface {
	ReadAll(io.Reader) ([]byte, error)
	ReadDir(string) ([]os.FileInfo, error)
	ReadFile(string) ([]byte, error)
	TempDir(string, string) (string, error)
	TempFile(string, string) (*os.File, error)
	WriteFile(string, []byte, os.FileMode) error
}

Ioutil is an interface around ioutil

type Real

type Real struct{}

Real is a wrapper around os that implements iioutil.Ioutil

func New

func New() *Real

New creates a struct that behaves like the ioutil package

func (*Real) ReadAll

func (*Real) ReadAll(r io.Reader) ([]byte, error)

ReadAll is a wrapper around ioutil.ReadAll()

func (*Real) ReadDir

func (*Real) ReadDir(dirname string) ([]os.FileInfo, error)

ReadDir is a wrapper around ioutil.ReadDir()

func (*Real) ReadFile

func (*Real) ReadFile(filename string) ([]byte, error)

ReadFile is a wrapper around ioutil.ReadFile()

func (*Real) TempDir

func (*Real) TempDir(dir, prefix string) (string, error)

TempDir is a wrapper around ioutil.TempDir()

func (*Real) TempFile

func (*Real) TempFile(dir, prefix string) (*os.File, error)

TempFile is a wrapper around ioutil.TempDir()

func (*Real) WriteFile

func (*Real) WriteFile(filename string, data []byte, perm os.FileMode) error

WriteFile is a wrapper around ioutil.TempDir()

Jump to

Keyboard shortcuts

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