util

package
v0.0.0-...-e0d34a4 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(source string, dest string) (bool, error)

CopyDir Recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist.

func CopyFile

func CopyFile(source string, dest string) error

CopyFile copies file source to destination dest.

func CopyTo

func CopyTo(source string, dest string) error

CopyTo copies source to dest If source is a file and dest is a file, performs copy file If source is a dir and dest is a dir, performs copy dir If source is a file and dest is a dir, copies source to the dest dir with the same name If source is a dir and dest is a file, returns error

func IsArchive

func IsArchive(source string) bool

IsArchive checks if the file is an archive

func IsJar

func IsJar(source string) bool

IsJar checks if the file is a jar

func UnTar

func UnTar(reader io.Reader, target string) error

Types

type Unarchiver

type Unarchiver struct {
	// contains filtered or unexported fields
}

func NewUnarchiver

func NewUnarchiver(parentLogger logger.Logger) (*Unarchiver, error)

func (*Unarchiver) Extract

func (d *Unarchiver) Extract(ctx context.Context, sourcePath string, targetPath string) error

Extract extracts the source archive to the target path

Jump to

Keyboard shortcuts

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