Version: v0.0.0-...-5e7b564 Latest Latest

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 16 Imported by: 0



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



This section is empty.


View Source
var (
	Lockless bool


func Abs

func Abs(path string) (string, error)

func CopyFile

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

func DaysSinceModified

func DaysSinceModified(filename string) (int, error)

func DirWalk

func DirWalk(directory string, report Report) error

func EnsureDirectory

func EnsureDirectory(directory string) (string, error)

func EnsureDirectoryExists

func EnsureDirectoryExists(directory string) error

func EnsureEmptyDirectory

func EnsureEmptyDirectory(directory string) error

func EnsureSharedDirectory

func EnsureSharedDirectory(directory string) (string, error)

func EnsureSharedParentDirectory

func EnsureSharedParentDirectory(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 ForceShared

func ForceShared()

func ForceSharedDir

func ForceSharedDir(fullpath string) (string, error)

func ForceTouchWhen

func ForceTouchWhen(location string, when time.Time)

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 IsEmptyDir

func IsEmptyDir(pathname string) bool

func IsFile

func IsFile(pathname string) bool

func IsSharedDir

func IsSharedDir(fullpath string) bool

func LockWaitMessage

func LockWaitMessage(message string) func()

func MakeSharedDir

func MakeSharedDir(fullpath string) (string, error)

func MakeSharedFile

func MakeSharedFile(fullpath string) (string, error)

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 RemoveEmptyDirectores

func RemoveEmptyDirectores(starting string) (err error)

func Sha256

func Sha256(filename string) (string, error)

func Size

func Size(pathname string) (int64, bool)
func Symlink(pathname string) (string, bool)

func TouchWhen

func TouchWhen(location string, when time.Time)

func Walk

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


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 {
	Marker string

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)

type Shared

type Shared interface {
	MakeSharedFile(fullpath string) (string, error)
	MakeSharedDir(fullpath string) (string, error)

Jump to

Keyboard shortcuts

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