filesystem

package
v0.0.0-...-fa857ea Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanManifestPath

func CleanManifestPath(manifestPath string) string

CleanManifestPath removes the path to the manifest file, in case the command was executed from a parent or child folder

func CopyFile

func CopyFile(from, to string) error

CopyFile copies a binary between from and to

func FileExists

func FileExists(name string) bool

FileExists return true if the file exists

func FileExistsAndNotDir

func FileExistsAndNotDir(path string, fs afero.Fs) bool

FileExistsAndNotDir checks if the file exists, and it's not a dir

func FileExistsWithFilesystem

func FileExistsWithFilesystem(path string, fs afero.Fs) bool

FileExistsWithFilesystem return true if the file exists or if there is an error.

func GetLastNLines

func GetLastNLines(fs afero.Fs, path string, n int, maxChunkByteSize int64) ([]string, error)

GetLastNLines returns the last N lines of a file up to a max amount of bytes

func GetManifestPathFromWorkdir

func GetManifestPathFromWorkdir(manifestPath, workdir string) string

GetManifestPathFromWorkdir returns the path from a workdir

func GetWorkdirFromManifestPath

func GetWorkdirFromManifestPath(manifestPath string) string

GetWorkdirFromManifestPath sets the path

func Realpath

func Realpath(fs afero.Fs, fname string) (string, error)

Realpath resolves the real path of a file.

Types

type OsWorkingDirectoryCtrl

type OsWorkingDirectoryCtrl struct{}

func NewOsWorkingDirectoryCtrl

func NewOsWorkingDirectoryCtrl() OsWorkingDirectoryCtrl

func (OsWorkingDirectoryCtrl) Change

func (OsWorkingDirectoryCtrl) Change(dir string) error

func (OsWorkingDirectoryCtrl) Get

type TemporalDirectoryCtrl

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

func NewTemporalDirectoryCtrl

func NewTemporalDirectoryCtrl(fs afero.Fs) TemporalDirectoryCtrl

func (TemporalDirectoryCtrl) Create

func (os TemporalDirectoryCtrl) Create() (string, error)

type TemporalDirectoryInterface

type TemporalDirectoryInterface interface {
	Create() (string, error)
}

type WorkingDirectoryInterface

type WorkingDirectoryInterface interface {
	Get() (string, error)
	Change(string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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