pathlib

package
Version: v0.0.0-...-685d2ac Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

This package hold common/shared file/path operations used in rcc.

Index

Constants

This section is empty.

Variables

View Source
var (
	Lockless bool
)

Functions

func Abs

func Abs(path string) (string, error)

func CopyFile

func CopyFile(source, target string, overwrite bool) error

func EnsureDirectory

func EnsureDirectory(directory string) (string, error)

func EnsureDirectoryExists

func EnsureDirectoryExists(directory string) error

func EnsureEmptyDirectory

func EnsureEmptyDirectory(directory string) error

func EnsureParentDirectory

func EnsureParentDirectory(resource string) (string, error)

func Exists

func Exists(pathname string) bool

func FileExist

func FileExist(name string) bool

func FindNamedPath

func FindNamedPath(basedir, name string) (string, error)

func ForceNothing

func ForceNothing(_ os.FileInfo) bool

func ForceWalk

func ForceWalk(directory string, force Forced, ignore Ignore, report Report) error

func Glob

func Glob(directory string, pattern string) []string

func IgnoreDirectories

func IgnoreDirectories(target os.FileInfo) bool

func IgnoreNothing

func IgnoreNothing(_ os.FileInfo) bool

func IsDir

func IsDir(pathname string) bool

func IsFile

func IsFile(pathname string) bool

func LockWaitMessage

func LockWaitMessage(message string) func()

func Md5

func Md5(filename string) (string, error)

func Modtime

func Modtime(pathname string) (time.Time, error)

func NoReporting

func NoReporting(string, string, os.FileInfo)

func Sha256

func Sha256(filename string) (string, error)

func Size

func Size(pathname string) (int64, bool)

func TouchWhen

func TouchWhen(location string, when time.Time)

func Walk

func Walk(directory string, ignore Ignore, report Report) error

Types

type Copier

type Copier func(string, string, bool) error

type Forced

type Forced func(os.FileInfo) bool

func ForceFilename

func ForceFilename(filename string) Forced

type Ignore

type Ignore func(os.FileInfo) bool

func CompositeIgnore

func CompositeIgnore(ignores ...Ignore) Ignore

func IgnorePattern

func IgnorePattern(text string) Ignore

func LoadIgnoreFile

func LoadIgnoreFile(filename string) (Ignore, error)

func LoadIgnoreFiles

func LoadIgnoreFiles(filenames []string) (Ignore, error)

type IgnoreNewer

type IgnoreNewer time.Time

func (IgnoreNewer) Ignore

func (it IgnoreNewer) Ignore(candidate os.FileInfo) bool

type IgnoreOlder

type IgnoreOlder time.Time

func (IgnoreOlder) Ignore

func (it IgnoreOlder) Ignore(candidate os.FileInfo) bool

type Locked

type Locked struct {
	*os.File
}

func (Locked) Release

func (it Locked) Release() error

type PathParts

type PathParts []string

func PathFrom

func PathFrom(parts ...string) PathParts

func TargetPath

func TargetPath() PathParts

func (PathParts) Absolute

func (it PathParts) Absolute() PathParts

func (PathParts) Append

func (it PathParts) Append(parts ...string) PathParts

func (PathParts) AsEnvironmental

func (it PathParts) AsEnvironmental(name string) string

func (PathParts) Prepend

func (it PathParts) Prepend(parts ...string) PathParts

func (PathParts) Remove

func (it PathParts) Remove(patterns []string) PathParts

func (PathParts) Which

func (it PathParts) Which(application string, extensions []string) (string, bool)

type Releaser

type Releaser interface {
	Release() error
}

func Fake

func Fake() Releaser

func Locker

func Locker(filename string, trycount int) (Releaser, error)

type Report

type Report func(string, string, os.FileInfo)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL