fsutil

package module
v0.0.0-...-f3ece97 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: MIT Imports: 10 Imported by: 0

README

go-git/go-billy Filesystem Utilities

This provides helper functions for copying, archiving with tar, and walking the filesystem.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(dst, src billy.Filesystem) error

Copy recursively from src to root

func FileNames

func FileNames(repo DirReader) ([]string, error)

FileNames returns name of non directory files For now this includes symlinks... this may change.

func HasDotPrefixedSegment

func HasDotPrefixedSegment(fp string) bool

func ReadFile

func ReadFile(dir billy.Basic, name string) ([]byte, error)

ReadFile is based on the standard library function fs.ReadFile

func ReadFromTarball

func ReadFromTarball(r io.Reader, fs billy.Filesystem) error

func SumFileNameAndContents

func SumFileNameAndContents(fs billy.Filesystem) (string, error)

func Walk

func Walk(fs billy.Filesystem, root string, walkFn filepath.WalkFunc) error

func WriteFile

func WriteFile(dir billy.Basic, name string, data []byte, perm os.FileMode) error

WriteFile is based on the standard library function os.WriteFile but adds a dir parameter

func WriteToTarball

func WriteToTarball(wr io.Writer, fs billy.Filesystem) (deferErr error)

Types

type DirReader

type DirReader interface {
	ReadDir(path string) ([]os.FileInfo, error)
}

Jump to

Keyboard shortcuts

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