fs

package
v0.0.0-...-5b41cc5 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2016 License: CC0-1.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToFile

func AppendToFile(filePath string, text string) error

AppendToFile adds text to a file

Types

type OSUtil

type OSUtil struct {
}

OSUtil is the struct for dealing with File System Operations on the disk.

func (OSUtil) AppendOrCreate

func (fs OSUtil) AppendOrCreate(filePath string, text string) error

AppendOrCreate adds text to file if it exists otherwise it creates a new file with the given text

func (OSUtil) Copy

func (fs OSUtil) Copy(source string, destination string) error

Copy copies one file from source to destination

func (OSUtil) CopyAll

func (fs OSUtil) CopyAll(source string, destination string) error

CopyAll copies recursively from source to destination

func (OSUtil) Mkdirs

func (fs OSUtil) Mkdirs(dir string) error

Mkdirs ensures that the directory is created.

func (OSUtil) OpenAndReadFile

func (fs OSUtil) OpenAndReadFile(file string) ([]byte, error)

OpenAndReadFile is a util that will check if the file exists, open and then read the file.

func (OSUtil) TempDir

func (fs OSUtil) TempDir(dir string, prefix string) (string, error)

TempDir creates a temp directory that the user is responsible for cleaning up

type Util

type Util interface {
	OpenAndReadFile(file string) ([]byte, error)
	CopyAll(source string, destination string) error
	Copy(source string, destination string) error
	TempDir(dir string, prefix string) (string, error)
	Mkdirs(dir string) error
	AppendOrCreate(filePath string, text string) error
}

Util is an interface for helper file system utilities.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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