iioutil

package module
v0.0.0-...-63c7fad Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: MIT Imports: 4 Imported by: 3

README

Build Status Coverage

problem statement

native ioutil package exposed via interface

features

  • API compatible w/ native ioutil package exposed via interface
  • fake implementation to allow faking interactions

Be advised: this project is currently at Major version zero. Per the semantic versioning spec: "Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable."

Releases

for every release:

Versioning

This project adheres to the Semantic Versioning specification

Contributing

see CONTRIBUTING.md

Changelog

see CHANGELOG.md

Documentation

Overview

Code generated by counterfeiter. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fake

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

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

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

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

func (*Fake) Invocations

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

func (*Fake) ReadAll

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

func (*Fake) ReadAllArgsForCall

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

func (*Fake) ReadAllCallCount

func (fake *Fake) ReadAllCallCount() int

func (*Fake) ReadAllReturns

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

func (*Fake) ReadAllReturnsOnCall

func (fake *Fake) ReadAllReturnsOnCall(i int, result1 []byte, result2 error)

func (*Fake) ReadDir

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

func (*Fake) ReadDirArgsForCall

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

func (*Fake) ReadDirCallCount

func (fake *Fake) ReadDirCallCount() int

func (*Fake) ReadDirReturns

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

func (*Fake) ReadDirReturnsOnCall

func (fake *Fake) ReadDirReturnsOnCall(i int, result1 []os.FileInfo, result2 error)

func (*Fake) ReadFile

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

func (*Fake) ReadFileArgsForCall

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

func (*Fake) ReadFileCallCount

func (fake *Fake) ReadFileCallCount() int

func (*Fake) ReadFileReturns

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

func (*Fake) ReadFileReturnsOnCall

func (fake *Fake) ReadFileReturnsOnCall(i int, result1 []byte, result2 error)

func (*Fake) WriteFile

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

func (*Fake) WriteFileArgsForCall

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

func (*Fake) WriteFileCallCount

func (fake *Fake) WriteFileCallCount() int

func (*Fake) WriteFileReturns

func (fake *Fake) WriteFileReturns(result1 error)

func (*Fake) WriteFileReturnsOnCall

func (fake *Fake) WriteFileReturnsOnCall(i int, result1 error)

type IIOUtil

type IIOUtil interface {
	// ReadAll reads from r until an error or EOF and returns the data it read.
	// A successful call returns err == nil, not err == EOF. Because ReadAll is
	// defined to read from src until EOF, it does not treat an EOF from Read
	// as an error to be reported.
	ReadAll(r io.Reader) ([]byte, error)

	// ReadDir reads the directory named by dirname and returns
	// a list of directory entries sorted by filename.
	ReadDir(dirname string) ([]os.FileInfo, error)

	// ReadFile reads the file named by filename and returns the contents.
	// A successful call returns err == nil, not err == EOF. Because ReadFile
	// reads the whole file, it does not treat an EOF from Read as an error
	// to be reported.
	ReadFile(filename string) ([]byte, error)

	// WriteFile writes data to a file named by filename.
	// If the file does not exist, WriteFile creates it with permissions perm;
	// otherwise WriteFile truncates it before writing.
	WriteFile(filename string, data []byte, perm os.FileMode) error
}

virtual filesystem interface

func New

func New() IIOUtil

Jump to

Keyboard shortcuts

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