filesystem

package
v1.501.10 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ChmodPath = "chmod"

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecCmdRunner

type ExecCmdRunner interface {
	Output() ([]byte, error)
}

ExecCmdRunner is the interface that wraps exec.Command from the os package

type Filesystem

type Filesystem struct {
	TimeSince     func(time.Time) time.Duration
	TimeUnix      func(int64, int64) time.Time
	IoutilTempDir func(string, string) (name string, err error)
	OsMkdirAll    func(string, fs.FileMode) error
	OsRename      func(string, string) error
	OsExecCommand func(string, ...string) ExecCmdRunner
	OsStat        func(string) (fs.FileInfo, error)
}

Filesystem creates multiple signatures representing functions that would normally interact directly with the filesystem

func NewDefault

func NewDefault() Filesystem

NewDefault creates a new default Filesystem

func (*Filesystem) ChangeDirectoryPermissions

func (f *Filesystem) ChangeDirectoryPermissions(directory string, permissions string) ([]byte, error)

ChangeDirectoryPermissions will update a directory to have the given permissions

func (*Filesystem) GetAccessTime

func (f *Filesystem) GetAccessTime(workspace fs.FileInfo) time.Duration

GetAccessTime finds the most recent time that a file was created, modified or accessed

func (*Filesystem) MoveDirectoryToTmp

func (f *Filesystem) MoveDirectoryToTmp(dir string, name string) (string, error)

MoveDirectoryToTmp will move a given directory to /tmp

Directories

Path Synopsis
Package mock contains generated files.
Package mock contains generated files.

Jump to

Keyboard shortcuts

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