gorecurcopy

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 License: MPL-2.0 Imports: 6 Imported by: 1

README

gorecurcopy

Build Status GoDoc Go Report Card Version

gorecurcopy copies directories recursively without external dependencies. Compatible with OSX, Linux, and Windows.

This fork improves upon plus3it's version by supplying a mockable interface for easier testing.

Example:

import (
	"github.com/tagatac/gorecurcopy"
)

...
copier := gorecurcopy.NewCopier()
err := copier.CopyDirectory("directory", "new_directory")

Documentation

Overview

Package gorecurcopy provides recursive copying in Go (golang) with a minimum of extra packages. Original concept by Oleg Neumyvakin (https://stackoverflow.com/users/1592008/oleg-neumyvakin) and modified by: Dirk Avery (2019) David Tagatac (2022)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Copier

type Copier interface {
	// CopyDirectory recursively copies a src directory to a destination.
	CopyDirectory(src, dst string) error
	// Copy copies a src file to a dst file where src and dst are regular files.
	Copy(src, dst string) error
	// CopySymLink copies a symbolic link from src to dst.
	CopySymLink(src, dst string) error
}

func NewCopier

func NewCopier() Copier

func NewCopierWithFs

func NewCopierWithFs(fs afero.Fs) Copier

Directories

Path Synopsis
Package mock_gorecurcopy is a generated GoMock package.
Package mock_gorecurcopy is a generated GoMock package.

Jump to

Keyboard shortcuts

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