Documentation ¶
Index ¶
- func Copy(src, dest string, opt ...CopyOption) error
- func DownloadFile(url string) (f *os.File, err error)
- func GitClone(repo string, outDir string) (err error)
- func IsEmpty(name string) (bool, error)
- func PathExists(name string) bool
- func Unzip(src string, dest string) ([]string, error)
- type CopyOption
- type Options
- type SymlinkAction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy ¶
func Copy(src, dest string, opt ...CopyOption) error
Copy copies src to dest, doesn't matter if src is a directory or a file.
func DownloadFile ¶
DownloadFile will download a url to a local file. It's efficient because it will write as it downloads and not load the whole file into memory.
Types ¶
type CopyOption ¶ added in v0.0.2
type CopyOption func(*Options)
CopyOption define a function type that handle optional actions.
type Options ¶
type Options struct { // OnSymlink can specify what to do on symlink OnSymlink func(src string) SymlinkAction // Skip can specify which files should be skipped Skip func(src string) bool // AddPermission to every entities, // NO MORE THAN 0777 AddPermission os.FileMode // Sync file after copy. // Useful in case when file must be on the disk // (in case crash happens, for example), // at the expense of some performance penalty Sync bool }
Options specifies optional actions on copying.
type SymlinkAction ¶
type SymlinkAction int
SymlinkAction represents what to do on symlink.
const ( // Deep creates hard-copy of contents. Deep SymlinkAction = iota // Shallow creates new symlink to the dest of symlink. Shallow // Skip does nothing with symlink. Skip )
Click to show internal directories.
Click to hide internal directories.