fswrite

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package fswrite provides a simple, mockable wrapper for dealing with FS IO.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FSWrite

type FSWrite struct{}

FSWrite provides a simple, mockable wrapper for dealing with FS IO.

func (*FSWrite) ListRecursive

func (*FSWrite) ListRecursive(dir string) ([]string, error)

ListRecursive returns every path that can be recursively found in the provided directory.

func (*FSWrite) MkdirAll

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

MkdirAll wraps os.MkdirAll.

func (*FSWrite) RemoveAll

func (*FSWrite) RemoveAll(path string) error

RemoveAll deletes the path and any sub paths.

func (*FSWrite) WriteFile

func (*FSWrite) WriteFile(filename string, data string, perm os.FileMode) error

WriteFile wraps ioutil.WriteFile.

type Writable

type Writable interface {
	WriteFile(filename string, data string, perm os.FileMode) error
	MkdirAll(path string, perm os.FileMode) error
	ListRecursive(dir string) ([]string, error)
	RemoveAll(paths string) error
}

Writable provides a simple, mockable wrapper for dealing with FS IO.

Jump to

Keyboard shortcuts

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