filesys

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package filesys provides a struct, FS, that receives several file system related methods.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS struct{}

FS is a struct owning several file system related methods. This package provides a struct rather than a bunch of public methods so that it can be passed in dependency injection.

func (*FS) CopyFile

func (f *FS) CopyFile(src, dst string) error

CopyFile copies a file from one path to another. Existing files are overwritten. Does not copy file attributes.

func (*FS) CreateUniqueTmpDir

func (f *FS) CreateUniqueTmpDir(parentPath string) (string, error)

CreateUniqueTmpDir generates a UUID and creates a directory under the passed parent path using the UUID as the directory name.

func (*FS) DeleteDir

func (f *FS) DeleteDir(path string) error

DeleteDir performs the equivalent of a rm -rf on the passed path.

func (*FS) GetFileNames

func (f *FS) GetFileNames(baseDir string) ([]string, error)

GetFileNames returns a slice of filenames in a directory. Does not include directory names.

func (*FS) GetSubDirectories

func (f *FS) GetSubDirectories(baseDir string) ([]string, error)

GetSubDirectories returns a list of directory names in a given directory. Does not include file names.

Jump to

Keyboard shortcuts

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