Skip to content
This repository has been archived by the owner on Oct 6, 2021. It is now read-only.
/ cabinet Public archive

A Go library that provides helpful functions for working with files.

License

Notifications You must be signed in to change notification settings

stephen-fox/cabinet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cabinet

What is it?

A Go library that provides several helpful functions for working with files.

How do I use it?

Execute the following on the commandline:

go get github.com/stephen-fox/cabinet

Then, in your Go application, add the following import statement:

import (
    "github.com/stephen-fox/cabinet"
)

What does the API look like?

  • Exists - Check if a file or directory exists
  • FileExists - Check if a file exists
  • DirectoryExists - Check if a directory exists
  • CopyFilesWithSuffix - Recursively copy files ending with a suffix. Optionally specify if existing files should be overwritten
  • CopyDirectory - Recursively copy a directory. Optionally specify if existing files should be overwritten
  • CopyFile - Copy a file. Optionally specify if an existing file should be overwritten
  • DownloadFile - Download a file
  • ReplaceLineInFile - Replace a line in a file
  • GetFileHash - Get a file's hash using the hash.Hash interface