Documentation
¶
Index ¶
- func AllowWildcards(ci *CopyInfo)
- func AllowXAttrErrors(ci *CopyInfo)
- func Chown(p string, old *User, fn Chowner) error
- func Copy(ctx context.Context, srcRoot, src, dstRoot, dst string, opts ...Opt) error
- func GetLinkInfo(fi os.FileInfo) (uint64, bool)
- func MkdirAll(path string, perm os.FileMode, user Chowner, tm *time.Time) error
- func ResolveWildcards(root, src string, followLinks bool) ([]string, error)
- func StatAtime(st *syscall.Stat_t) syscall.Timespec
- func StatMtime(st *syscall.Stat_t) syscall.Timespec
- func Utimes(p string, tm *time.Time) error
- func WithCopyInfo(ci CopyInfo) func(*CopyInfo)
- type Chowner
- type CopyInfo
- type Opt
- type User
- type XAttrErrorHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowWildcards ¶
func AllowWildcards(ci *CopyInfo)
func AllowXAttrErrors ¶
func AllowXAttrErrors(ci *CopyInfo)
func Copy ¶
Copy copies files using `cp -a` semantics. Copy is likely unsafe to be used in non-containerized environments.
func GetLinkInfo ¶
GetLinkInfo returns an identifier representing the node a hardlink is pointing to. If the file is not hard linked then 0 will be returned.
func WithCopyInfo ¶
Types ¶
type CopyInfo ¶
type CopyInfo struct {
Chown Chowner
Utime *time.Time
AllowWildcards bool
Mode *int
XAttrErrorHandler XAttrErrorHandler
CopyDirContents bool
FollowLinks bool
// Only allows *only* these files/dirs to be copied
Only map[string]struct{}
// Include only files/dirs matching at least one of these patterns
IncludePatterns []string
// Exclude files/dir matching any of these patterns (even if they match an include pattern)
ExcludePatterns []string
// UseGitignore indicates that .gitignore files should be respected
UseGitignore bool
// If true, any source path that overwrite existing destination paths will always replace
// the existing destination path, even if they are of different types (e.g. a directory will
// replace any existing symlink or file)
AlwaysReplaceExistingDestPaths bool
ChangeFunc fsutil.ChangeFunc
}
type Opt ¶
type Opt func(*CopyInfo)
func WithChangeNotifier ¶
func WithChangeNotifier(fn fsutil.ChangeFunc) Opt
func WithExcludePattern ¶
func WithIncludePattern ¶
func WithXAttrErrorHandler ¶
func WithXAttrErrorHandler(h XAttrErrorHandler) Opt
type XAttrErrorHandler ¶
Click to show internal directories.
Click to hide internal directories.