file

package
v0.0.0-...-260b785 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File file

File is use for mocking

Functions

This section is empty.

Types

type Mocket

type Mocket struct {
	mock.Mock
}

Mocket used during test

func (*Mocket) Close

func (m *Mocket) Close(f *os.File) error

Close is used to close the file during test

func (*Mocket) IsDir

func (m *Mocket) IsDir(f os.FileInfo) bool

IsDir is use to check if path is directory during test

func (*Mocket) IsNotExist

func (m *Mocket) IsNotExist(err error) bool

IsNotExist is used to check if directory exits during test

func (*Mocket) MkdirAll

func (m *Mocket) MkdirAll(path string, perm os.FileMode) error

MkdirAll is used to create a directory during test

func (*Mocket) OpenFile

func (m *Mocket) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)

OpenFile is used to create a directory during test

func (*Mocket) Post

func (m *Mocket) Post(url, contentType string, body io.Reader) (resp *http.Response, err error)

Post makes http post request during testing

func (*Mocket) ReadFile

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

ReadFile is used to read a file during test

func (*Mocket) Stat

func (m *Mocket) Stat(name string) (os.FileInfo, error)

Stat is used to check if directory exits during test

func (*Mocket) Write

func (m *Mocket) Write(f *os.File, b []byte) (n int, err error)

Write is use to write to a file during test

func (*Mocket) WriteFile

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

WriteFile is used to write a file during test

Jump to

Keyboard shortcuts

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