filesystem

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package filesystem provides file system access

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileReader

type FileReader interface {
	ReadFile(string) ([]byte, error)
}

FileReader is a wrapper for file system access

type IoutilFileReader

type IoutilFileReader struct{}

IoutilFileReader uses io/ioutil to implement FileReader

func (IoutilFileReader) ReadFile

func (r IoutilFileReader) ReadFile(filename string) ([]byte, error)

ReadFile returns the file data found at the file path

type MockFile

type MockFile struct {
	Data []byte
	Err  error
}

MockFile is some mock file data

type MockReader

type MockReader struct {
	Files map[string]MockFile
}

MockReader is a mock implementation of the Reader interface, for testing purposes

func (MockReader) ReadFile

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

ReadFile returns a pre-set data/error pair

Jump to

Keyboard shortcuts

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