go-ape

module
v0.0.0-...-3ada71e Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: Apache-2.0

README

GoDoc Go Report Card Build Status codecov

go-ape

go-ape provides some file utilities in two packages:

  • pkg/filecopy for copying files (hence the "ape" in "go-ape")
  • pkg/furl for reading local files and remote urls in a consistent way

It was initially developed on macOS and then made to work on Windows.

Installing

Install is easy, all you need to do is

go get github.com/pivotal/go-ape

Usage

Once installed, import go-ape in your application

import "github.com/pivotal/go-ape"

Read files

Then start reading files like so:

content, err := furl.Read(filePath, "")

Here filePath can be a path on the local file system (unix OR windows) or a URL.

Copy

You can copy files or directories using:

filecopy.Copy(outputPath, inputPath)

Please see the godoc for more information.

Alternatives

https://github.com/otiai10/copy copies files and directories, but incompatibly to go-ape (replacing the implementation here with otiai10/copy caused numerous test failures).

Directories

Path Synopsis
pkg
filecopy
package filecopy provides functions to copy files and directories.
package filecopy provides functions to copy files and directories.
furl
package furl contains functions that treat local files and urls uniformly.
package furl contains functions that treat local files and urls uniformly.

Jump to

Keyboard shortcuts

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