Documentation ¶
Index ¶
- Variables
- func MustReadFileAsString(path string) (content string)
- func MustWriteStringToFile(path string, content string, verbose bool)
- func ReadFileAsString(path string) (content string, err error)
- func WriteStringToFile(path string, content string, verbose bool) (err error)
- type CommandExecutorDirectory
- func GetCommandExecutorDirectoryByPath(commandExecutor commandexecutor.CommandExecutor, path string) (c *CommandExecutorDirectory, err error)
- func GetLocalCommandExecutorDirectoryByPath(path string) (c *CommandExecutorDirectory, err error)
- func MustGetCommandExecutorDirectoryByPath(commandExecutor commandexecutor.CommandExecutor, path string) (c *CommandExecutorDirectory)
- func MustGetLocalCommandExecutorDirectoryByPath(path string) (c *CommandExecutorDirectory)
- func MustNewCommandExecutorDirectory(commandExecutor commandexecutor.CommandExecutor) (c *CommandExecutorDirectory)
- func NewCommandExecutorDirectory(commandExecutor commandexecutor.CommandExecutor) (c *CommandExecutorDirectory, err error)
- func (c *CommandExecutorDirectory) Chmod(chmodOptions *parameteroptions.ChmodOptions) (err error)
- func (c *CommandExecutorDirectory) CopyContentToDirectory(destinationDir Directory, verbose bool) (err error)
- func (c *CommandExecutorDirectory) Create(verbose bool) (err error)
- func (c *CommandExecutorDirectory) CreateSubDirectory(subDirectoryName string, verbose bool) (createdSubDirectory Directory, err error)
- func (c *CommandExecutorDirectory) Delete(verbose bool) (err error)
- func (c *CommandExecutorDirectory) Exists(verbose bool) (exists bool, err error)
- func (c *CommandExecutorDirectory) GetBaseName() (baseName string, err error)
- func (c *CommandExecutorDirectory) GetCommandExecutor() (commandExecutor commandexecutor.CommandExecutor, err error)
- func (c *CommandExecutorDirectory) GetCommandExecutorAndDirPath() (commandExecutor commandexecutor.CommandExecutor, dirPath string, err error)
- func (c *CommandExecutorDirectory) GetCommandExecutorAndDirPathAndHostDescription() (commandExecutor commandexecutor.CommandExecutor, dirPath string, ...)
- func (c *CommandExecutorDirectory) GetDirName() (parentPath string, err error)
- func (c *CommandExecutorDirectory) GetDirPath() (dirPath string, err error)
- func (c *CommandExecutorDirectory) GetFileInDirectory(pathToFile ...string) (file File, err error)
- func (c *CommandExecutorDirectory) GetHostDescription() (hostDescription string, err error)
- func (c *CommandExecutorDirectory) GetLocalPath() (localPath string, err error)
- func (c *CommandExecutorDirectory) GetParentDirectory() (parent Directory, err error)
- func (c *CommandExecutorDirectory) GetPath() (path string, err error)
- func (c *CommandExecutorDirectory) GetSubDirectory(path ...string) (subDirectory Directory, err error)
- func (c *CommandExecutorDirectory) IsLocalDirectory() (isLocalDirectory bool, err error)
- func (c *CommandExecutorDirectory) ListFilePaths(listFileOptions *parameteroptions.ListFileOptions) (filePaths []string, err error)
- func (c *CommandExecutorDirectory) ListFiles(listFileOptions *parameteroptions.ListFileOptions) (files []File, err error)
- func (c *CommandExecutorDirectory) ListSubDirectories(options *parameteroptions.ListDirectoryOptions) (subDirectories []Directory, err error)
- func (c *CommandExecutorDirectory) MustChmod(chmodOptions *parameteroptions.ChmodOptions)
- func (c *CommandExecutorDirectory) MustCopyContentToDirectory(destinationDir Directory, verbose bool)
- func (c *CommandExecutorDirectory) MustCreate(verbose bool)
- func (c *CommandExecutorDirectory) MustCreateSubDirectory(subDirectoryName string, verbose bool) (createdSubDirectory Directory)
- func (c *CommandExecutorDirectory) MustDelete(verbose bool)
- func (c *CommandExecutorDirectory) MustExists(verbose bool) (exists bool)
- func (c *CommandExecutorDirectory) MustGetBaseName() (baseName string)
- func (c *CommandExecutorDirectory) MustGetCommandExecutor() (commandExecutor commandexecutor.CommandExecutor)
- func (c *CommandExecutorDirectory) MustGetCommandExecutorAndDirPath() (commandExecutor commandexecutor.CommandExecutor, dirPath string)
- func (c *CommandExecutorDirectory) MustGetCommandExecutorAndDirPathAndHostDescription() (commandExecutor commandexecutor.CommandExecutor, dirPath string, ...)
- func (c *CommandExecutorDirectory) MustGetDirName() (dirName string)
- func (c *CommandExecutorDirectory) MustGetDirPath() (dirPath string)
- func (c *CommandExecutorDirectory) MustGetFileInDirectory(pathToFile ...string) (file File)
- func (c *CommandExecutorDirectory) MustGetHostDescription() (hostDescription string)
- func (c *CommandExecutorDirectory) MustGetLocalPath() (localPath string)
- func (c *CommandExecutorDirectory) MustGetParentDirectory() (parent Directory)
- func (c *CommandExecutorDirectory) MustGetPath() (path string)
- func (c *CommandExecutorDirectory) MustGetSubDirectory(path ...string) (subDirectory Directory)
- func (c *CommandExecutorDirectory) MustIsLocalDirectory() (isLocalDirectory bool)
- func (c *CommandExecutorDirectory) MustListFilePaths(listFileOptions *parameteroptions.ListFileOptions) (filePaths []string)
- func (c *CommandExecutorDirectory) MustListFiles(listFileOptions *parameteroptions.ListFileOptions) (files []File)
- func (c *CommandExecutorDirectory) MustListSubDirectories(options *parameteroptions.ListDirectoryOptions) (subDirectories []Directory)
- func (c *CommandExecutorDirectory) MustSetCommandExecutor(commandExecutor commandexecutor.CommandExecutor)
- func (c *CommandExecutorDirectory) MustSetDirPath(dirPath string)
- func (c *CommandExecutorDirectory) SetCommandExecutor(commandExecutor commandexecutor.CommandExecutor) (err error)
- func (c *CommandExecutorDirectory) SetDirPath(dirPath string) (err error)
- type CommandExecutorFile
- func GetCommandExecutorFileByPath(commandExector commandexecutor.CommandExecutor, path string) (commandExecutorFile *CommandExecutorFile, err error)
- func GetLocalCommandExecutorFileByFile(file File, verbose bool) (commandExecutorFile *CommandExecutorFile, err error)
- func GetLocalCommandExecutorFileByPath(localPath string) (commandExecutorFile *CommandExecutorFile, err error)
- func MustGetCommandExecutorFileByPath(commandExector commandexecutor.CommandExecutor, path string) (commandExecutorFile *CommandExecutorFile)
- func MustGetLocalCommandExecutorFileByFile(file File, verbose bool) (commandExecutorFile *CommandExecutorFile)
- func MustGetLocalCommandExecutorFileByPath(localPath string) (commandExecutorFile *CommandExecutorFile)
- func NewCommandExecutorFile() (c *CommandExecutorFile)
- func (c *CommandExecutorFile) AppendBytes(toWrite []byte, verbose bool) (err error)
- func (c *CommandExecutorFile) AppendString(toWrite string, verbose bool) (err error)
- func (c *CommandExecutorFile) Chmod(chmodOptions *parameteroptions.ChmodOptions) (err error)
- func (c *CommandExecutorFile) Chown(options *parameteroptions.ChownOptions) (err error)
- func (c *CommandExecutorFile) CopyToFile(destFile File, verbose bool) (err error)
- func (c *CommandExecutorFile) Create(verbose bool) (err error)
- func (c *CommandExecutorFile) Delete(verbose bool) (err error)
- func (c *CommandExecutorFile) Exists(verbose bool) (exists bool, err error)
- func (c *CommandExecutorFile) GetBaseName() (baseName string, err error)
- func (c *CommandExecutorFile) GetCommandExecutor() (commandExecutor commandexecutor.CommandExecutor, err error)
- func (c *CommandExecutorFile) GetCommandExecutorAndFilePath() (commandExecutor commandexecutor.CommandExecutor, filePath string, err error)
- func (c *CommandExecutorFile) GetCommandExecutorAndFilePathAndHostDescription() (commandExecutor commandexecutor.CommandExecutor, filePath string, ...)
- func (c *CommandExecutorFile) GetDeepCopy() (deepCopy File)
- func (c *CommandExecutorFile) GetFilePath() (filePath string, err error)
- func (c *CommandExecutorFile) GetHostDescription() (hostDescription string, err error)
- func (c *CommandExecutorFile) GetLocalPath() (localPath string, err error)
- func (c *CommandExecutorFile) GetLocalPathOrEmptyStringIfUnset() (localPath string, err error)
- func (c *CommandExecutorFile) GetParentDirectory() (parentDirectory Directory, err error)
- func (c *CommandExecutorFile) GetPath() (path string, err error)
- func (c *CommandExecutorFile) GetPathAndHostDescription() (path string, hostDescription string, err error)
- func (c *CommandExecutorFile) GetSizeBytes() (fileSize int64, err error)
- func (c *CommandExecutorFile) GetUriAsString() (uri string, err error)
- func (c *CommandExecutorFile) IsRunningOnLocalhost() (isRunningOnLocalhost bool, err error)
- func (c *CommandExecutorFile) MoveToPath(path string, useSudo bool, verbose bool) (movedFile File, err error)
- func (c *CommandExecutorFile) MustAppendBytes(toWrite []byte, verbose bool)
- func (c *CommandExecutorFile) MustAppendString(toWrite string, verbose bool)
- func (c *CommandExecutorFile) MustChmod(chmodOptions *parameteroptions.ChmodOptions)
- func (c *CommandExecutorFile) MustChown(options *parameteroptions.ChownOptions)
- func (c *CommandExecutorFile) MustCopyToFile(destFile File, verbose bool)
- func (c *CommandExecutorFile) MustCreate(verbose bool)
- func (c *CommandExecutorFile) MustDelete(verbose bool)
- func (c *CommandExecutorFile) MustExists(verbose bool) (exist bool)
- func (c *CommandExecutorFile) MustGetBaseName() (baseName string)
- func (c *CommandExecutorFile) MustGetCommandExecutor() (commandExecutor commandexecutor.CommandExecutor)
- func (c *CommandExecutorFile) MustGetCommandExecutorAndFilePath() (commandExecutor commandexecutor.CommandExecutor, filePath string)
- func (c *CommandExecutorFile) MustGetCommandExecutorAndFilePathAndHostDescription() (commandExecutor commandexecutor.CommandExecutor, filePath string, ...)
- func (c *CommandExecutorFile) MustGetFilePath() (filePath string)
- func (c *CommandExecutorFile) MustGetHostDescription() (hostDescription string)
- func (c *CommandExecutorFile) MustGetLocalPath() (localPath string)
- func (c *CommandExecutorFile) MustGetLocalPathOrEmptyStringIfUnset() (localPath string)
- func (c *CommandExecutorFile) MustGetParentDirectory() (parentDirectory Directory)
- func (c *CommandExecutorFile) MustGetPath() (path string)
- func (c *CommandExecutorFile) MustGetPathAndHostDescription() (path string, hostDescription string)
- func (c *CommandExecutorFile) MustGetSizeBytes() (fileSize int64)
- func (c *CommandExecutorFile) MustGetUriAsString() (uri string)
- func (c *CommandExecutorFile) MustIsRunningOnLocalhost() (isRunningOnLocalhost bool)
- func (c *CommandExecutorFile) MustMoveToPath(path string, useSudo bool, verbose bool) (movedFile File)
- func (c *CommandExecutorFile) MustReadAsBytes() (content []byte)
- func (c *CommandExecutorFile) MustReadFirstNBytes(numberOfBytesToRead int) (firstBytes []byte)
- func (c *CommandExecutorFile) MustSecurelyDelete(verbose bool)
- func (c *CommandExecutorFile) MustSetCommandExecutor(commandExecutor commandexecutor.CommandExecutor)
- func (c *CommandExecutorFile) MustSetFilePath(filePath string)
- func (c *CommandExecutorFile) MustTruncate(newSizeBytes int64, verbose bool)
- func (c *CommandExecutorFile) MustWriteBytes(toWrite []byte, verbose bool)
- func (c *CommandExecutorFile) ReadAsBytes() (content []byte, err error)
- func (c *CommandExecutorFile) ReadFirstNBytes(numberOfBytesToRead int) (firstBytes []byte, err error)
- func (c *CommandExecutorFile) SecurelyDelete(verbose bool) (err error)
- func (c *CommandExecutorFile) SetCommandExecutor(commandExecutor commandexecutor.CommandExecutor) (err error)
- func (c *CommandExecutorFile) SetFilePath(filePath string) (err error)
- func (c *CommandExecutorFile) Truncate(newSizeBytes int64, verbose bool) (err error)
- func (c *CommandExecutorFile) WriteBytes(toWrite []byte, verbose bool) (err error)
- type DirectoriesService
- type Directory
- type DirectoryBase
- func (d *DirectoryBase) CheckExists(verbose bool) (err error)
- func (d *DirectoryBase) CreateFileInDirectory(verbose bool, path ...string) (createdFile File, err error)
- func (d *DirectoryBase) CreateFileInDirectoryFromString(content string, verbose bool, pathToCreate ...string) (createdFile File, err error)
- func (d *DirectoryBase) DeleteFilesMatching(listFileOptions *parameteroptions.ListFileOptions) (err error)
- func (d *DirectoryBase) FileInDirectoryExists(verbose bool, path ...string) (fileExists bool, err error)
- func (d *DirectoryBase) GetFilePathInDirectory(path ...string) (filePath string, err error)
- func (d *DirectoryBase) GetParentDirectoryForBaseClass() (parentDirectoryForBaseClass Directory, err error)
- func (d *DirectoryBase) GetPathAndHostDescription() (path string, hostDescription string, err error)
- func (d *DirectoryBase) ListFilePaths(listFileOptions *parameteroptions.ListFileOptions) (filePaths []string, err error)
- func (d *DirectoryBase) ListSubDirectoryPaths(options *parameteroptions.ListDirectoryOptions) (subDirectoryPaths []string, err error)
- func (d *DirectoryBase) MustCheckExists(verbose bool)
- func (d *DirectoryBase) MustCreateFileInDirectory(verbose bool, path ...string) (createdFile File)
- func (d *DirectoryBase) MustCreateFileInDirectoryFromString(content string, verbose bool, pathToCreate ...string) (createdFile File)
- func (d *DirectoryBase) MustDeleteFilesMatching(listFileOptions *parameteroptions.ListFileOptions)
- func (d *DirectoryBase) MustFileInDirectoryExists(verbose bool, path ...string) (fileExists bool)
- func (d *DirectoryBase) MustGetFilePathInDirectory(path ...string) (filePath string)
- func (d *DirectoryBase) MustGetParentDirectoryForBaseClass() (parentDirectoryForBaseClass Directory)
- func (d *DirectoryBase) MustGetPathAndHostDescription() (path string, hostDescription string)
- func (d *DirectoryBase) MustListFilePaths(listFileOptions *parameteroptions.ListFileOptions) (filePaths []string)
- func (d *DirectoryBase) MustListSubDirectoryPaths(options *parameteroptions.ListDirectoryOptions) (subDirectoryPaths []string)
- func (d *DirectoryBase) MustReadFileInDirectoryAsInt64(path ...string) (value int64)
- func (d *DirectoryBase) MustReadFileInDirectoryAsLines(path ...string) (content []string)
- func (d *DirectoryBase) MustReadFileInDirectoryAsString(path ...string) (content string)
- func (d *DirectoryBase) MustReadFirstLineOfFileInDirectoryAsString(path ...string) (firstLine string)
- func (d *DirectoryBase) MustSetParentDirectoryForBaseClass(parentDirectoryForBaseClass Directory)
- func (d *DirectoryBase) MustWriteBytesToFile(content []byte, verbose bool, path ...string) (writtenFile File)
- func (d *DirectoryBase) MustWriteStringToFileInDirectory(content string, verbose bool, path ...string) (writtenFile File)
- func (d *DirectoryBase) ReadFileInDirectoryAsInt64(path ...string) (value int64, err error)
- func (d *DirectoryBase) ReadFileInDirectoryAsLines(path ...string) (content []string, err error)
- func (d *DirectoryBase) ReadFileInDirectoryAsString(path ...string) (content string, err error)
- func (d *DirectoryBase) ReadFirstLineOfFileInDirectoryAsString(path ...string) (firstLine string, err error)
- func (d *DirectoryBase) SetParentDirectoryForBaseClass(parentDirectoryForBaseClass Directory) (err error)
- func (c *DirectoryBase) WriteBytesToFile(content []byte, verbose bool, path ...string) (writtenFile File, err error)
- func (d *DirectoryBase) WriteStringToFileInDirectory(content string, verbose bool, path ...string) (writtenFile File, err error)
- type File
- type FileBase
- func (f *FileBase) AppendLine(line string, verbose bool) (err error)
- func (f *FileBase) CheckIsLocalFile(verbose bool) (err error)
- func (f *FileBase) ContainsLine(line string) (containsLine bool, err error)
- func (f *FileBase) CreateParentDirectory(verbose bool) (err error)
- func (f *FileBase) EnsureEndsWithLineBreak(verbose bool) (err error)
- func (f *FileBase) EnsureLineInFile(line string, verbose bool) (err error)
- func (xxx *FileBase) GetCreationDateByFileName(verbose bool) (creationDate *time.Time, err error)
- func (f *FileBase) GetFileTypeDescription(verbose bool) (fileTypeDescription string, err error)
- func (f *FileBase) GetMimeType(verbose bool) (mimeType string, err error)
- func (f *FileBase) GetNumberOfLinesWithPrefix(prefix string, trimLines bool) (nLines int, err error)
- func (f *FileBase) GetNumberOfNonEmptyLines() (nLines int, err error)
- func (f *FileBase) GetParentDirectoryPath() (parentDirectoryPath string, err error)
- func (f *FileBase) GetParentFileForBaseClass() (parentFileForBaseClass File, err error)
- func (f *FileBase) GetPathAndHostDescription() (path string, hostDescription string, err error)
- func (f *FileBase) GetSha256Sum() (sha256sum string, err error)
- func (f *FileBase) GetTextBlocks(verbose bool) (textBlocks []string, err error)
- func (f *FileBase) GetValueAsInt(key string) (value int, err error)
- func (f *FileBase) GetValueAsString(key string) (value string, err error)
- func (f *FileBase) IsContentEqualByComparingSha256Sum(otherFile File, verbose bool) (isEqual bool, err error)
- func (f *FileBase) IsEmptyFile() (isEmtpyFile bool, err error)
- func (f *FileBase) IsLocalFile(verbose bool) (isLocalFile bool, err error)
- func (f *FileBase) IsMatchingSha256Sum(sha256sum string) (isMatching bool, err error)
- func (f *FileBase) IsPgpEncrypted(verbose bool) (isEncrypted bool, err error)
- func (f *FileBase) IsYYYYmmdd_HHMMSSPrefix() (hasDatePrefix bool, err error)
- func (f *FileBase) MustAppendLine(line string, verbose bool)
- func (f *FileBase) MustCheckIsLocalFile(verbose bool)
- func (f *FileBase) MustContainsLine(line string) (containsLine bool)
- func (f *FileBase) MustCreateParentDirectory(verbose bool)
- func (f *FileBase) MustEnsureEndsWithLineBreak(verbose bool)
- func (f *FileBase) MustEnsureLineInFile(line string, verbose bool)
- func (f *FileBase) MustGetCreationDateByFileName(verbose bool) (creationDate *time.Time)
- func (f *FileBase) MustGetFileTypeDescription(verbose bool) (fileTypeDescription string)
- func (f *FileBase) MustGetMimeType(verbose bool) (mimeType string)
- func (f *FileBase) MustGetNumberOfLinesWithPrefix(prefix string, trimLines bool) (nLines int)
- func (f *FileBase) MustGetNumberOfNonEmptyLines() (nLines int)
- func (f *FileBase) MustGetParentDirectoryPath() (parentDirectoryPath string)
- func (f *FileBase) MustGetParentFileForBaseClass() (parentFileForBaseClass File)
- func (f *FileBase) MustGetPathAndHostDescription() (path string, hostDescription string)
- func (f *FileBase) MustGetSha256Sum() (sha256sum string)
- func (f *FileBase) MustGetTextBlocks(verbose bool) (textBlocks []string)
- func (f *FileBase) MustGetValueAsInt(key string) (value int)
- func (f *FileBase) MustGetValueAsString(key string) (value string)
- func (f *FileBase) MustIsContentEqualByComparingSha256Sum(otherFile File, verbose bool) (isEqual bool)
- func (f *FileBase) MustIsEmptyFile() (isEmtpyFile bool)
- func (f *FileBase) MustIsLocalFile(verbose bool) (isLocalFile bool)
- func (f *FileBase) MustIsMatchingSha256Sum(sha256sum string) (isMatching bool)
- func (f *FileBase) MustIsPgpEncrypted(verbose bool) (isEncrypted bool)
- func (f *FileBase) MustIsYYYYmmdd_HHMMSSPrefix() (hasDatePrefix bool)
- func (f *FileBase) MustPrintContentOnStdout()
- func (f *FileBase) MustReadAsBool() (boolValue bool)
- func (f *FileBase) MustReadAsFloat64() (content float64)
- func (f *FileBase) MustReadAsInt() (readValue int)
- func (f *FileBase) MustReadAsInt64() (readValue int64)
- func (f *FileBase) MustReadAsLines() (contentLines []string)
- func (f *FileBase) MustReadAsLinesWithoutComments() (contentLines []string)
- func (f *FileBase) MustReadAsString() (content string)
- func (f *FileBase) MustReadAsTimeTime() (date *time.Time)
- func (f *FileBase) MustReadFirstLine() (firstLine string)
- func (f *FileBase) MustReadFirstLineAndTrimSpace() (firstLine string)
- func (f *FileBase) MustReadLastCharAsString() (lastChar string)
- func (f *FileBase) MustRemoveLinesWithPrefix(prefix string, verbose bool)
- func (f *FileBase) MustReplaceLineAfterLine(lineToFind string, replaceLineAfterWith string, verbose bool) (changeSummary *changesummary.ChangeSummary)
- func (f *FileBase) MustSetParentFileForBaseClass(parentFileForBaseClass File)
- func (f *FileBase) MustSortBlocksInFile(verbose bool)
- func (f *FileBase) MustTrimSpacesAtBeginningOfFile(verbose bool)
- func (f *FileBase) MustWriteInt64(toWrite int64, verbose bool)
- func (f *FileBase) MustWriteLines(linesToWrite []string, verbose bool)
- func (f *FileBase) MustWriteString(toWrite string, verbose bool)
- func (f *FileBase) MustWriteTextBlocks(textBlocks []string, verbose bool)
- func (f *FileBase) PrintContentOnStdout() (err error)
- func (f *FileBase) ReadAsBool() (boolValue bool, err error)
- func (f *FileBase) ReadAsFloat64() (content float64, err error)
- func (f *FileBase) ReadAsInt() (readValue int, err error)
- func (f *FileBase) ReadAsInt64() (readValue int64, err error)
- func (f *FileBase) ReadAsLines() (contentLines []string, err error)
- func (f *FileBase) ReadAsLinesWithoutComments() (contentLines []string, err error)
- func (f *FileBase) ReadAsString() (content string, err error)
- func (f *FileBase) ReadAsTimeTime() (date *time.Time, err error)
- func (f *FileBase) ReadFirstLine() (firstLine string, err error)
- func (f *FileBase) ReadFirstLineAndTrimSpace() (firstLine string, err error)
- func (f *FileBase) ReadLastCharAsString() (lastChar string, err error)
- func (f *FileBase) RemoveLinesWithPrefix(prefix string, verbose bool) (err error)
- func (f *FileBase) ReplaceLineAfterLine(lineToFind string, replaceLineAfterWith string, verbose bool) (changeSummary *changesummary.ChangeSummary, err error)
- func (f *FileBase) SetParentFileForBaseClass(parentFileForBaseClass File) (err error)
- func (f *FileBase) SortBlocksInFile(verbose bool) (err error)
- func (f *FileBase) TrimSpacesAtBeginningOfFile(verbose bool) (err error)
- func (f *FileBase) WriteInt64(toWrite int64, verbose bool) (err error)
- func (f *FileBase) WriteLines(linesToWrite []string, verbose bool) (err error)
- func (f *FileBase) WriteString(toWrite string, verbose bool) (err error)
- func (f *FileBase) WriteTextBlocks(textBlocks []string, verbose bool) (err error)
- type FileInfo
- func (f *FileInfo) GetPath() (path string, err error)
- func (f *FileInfo) GetPathAndSizeBytes() (path string, sizeBytes int64, err error)
- func (f *FileInfo) GetSizeBytes() (sizeBytes int64, err error)
- func (f *FileInfo) MustGetPath() (path string)
- func (f *FileInfo) MustGetPathAndSizeBytes() (path string, sizeBytes int64)
- func (f *FileInfo) MustGetSizeBytes() (sizeBytes int64)
- func (f *FileInfo) MustSetPath(path string)
- func (f *FileInfo) MustSetSizeBytes(sizeBytes int64)
- func (f *FileInfo) SetPath(path string) (err error)
- func (f *FileInfo) SetSizeBytes(sizeBytes int64) (err error)
- type FilesService
- func (f *FilesService) MustReadAsString(path string) (content string)
- func (f *FilesService) MustWriteStringToFile(path string, content string, verbose bool)
- func (f *FilesService) ReadAsString(path string) (content string, err error)
- func (f *FilesService) WriteStringToFile(path string, content string, verbose bool) (err error)
- type LocalDirectory
- func GetCurrentWorkingDirectory() (workingDirectory *LocalDirectory, err error)
- func GetLocalDirectoryByPath(path string) (l *LocalDirectory, err error)
- func MustGetCurrentWorkingDirectory() (workingDirectory *LocalDirectory)
- func MustGetLocalDirectoryByPath(path string) (l *LocalDirectory)
- func NewLocalDirectory() (l *LocalDirectory)
- func (l *LocalDirectory) Chmod(chmodOptions *parameteroptions.ChmodOptions) (err error)
- func (l *LocalDirectory) CopyContentToDirectory(destinationDir Directory, verbose bool) (err error)
- func (l *LocalDirectory) CopyContentToLocalDirectory(destDirectory *LocalDirectory, verbose bool) (err error)
- func (l *LocalDirectory) Create(verbose bool) (err error)
- func (l *LocalDirectory) CreateFileInDirectory(verbose bool, path ...string) (createdFile File, err error)
- func (l *LocalDirectory) CreateFilesInDirectory(filesToCreate []string, verbose bool) (createdFiles []File, err error)
- func (l *LocalDirectory) CreateSubDirectory(subDirName string, verbose bool) (createdSubDir Directory, err error)
- func (l *LocalDirectory) Delete(verbose bool) (err error)
- func (l *LocalDirectory) Exists(verbose bool) (exists bool, err error)
- func (l *LocalDirectory) GetBaseName() (baseName string, err error)
- func (l *LocalDirectory) GetDirName() (parentPath string, err error)
- func (l *LocalDirectory) GetFileInDirectory(path ...string) (file File, err error)
- func (l *LocalDirectory) GetFileInDirectoryAsLocalFile(filePath ...string) (localFile *LocalFile, err error)
- func (l *LocalDirectory) GetHostDescription() (hostDescription string, err error)
- func (l *LocalDirectory) GetLocalPath() (localPath string, err error)
- func (l *LocalDirectory) GetParentDirectory() (parentDirectory Directory, err error)
- func (l *LocalDirectory) GetPath() (dirPath string, err error)
- func (l *LocalDirectory) GetSubDirectory(path ...string) (subDirectory Directory, err error)
- func (l *LocalDirectory) GetSubDirectoryAndLocalPath(path ...string) (subDirectory Directory, subDirectoryPath string, err error)
- func (l *LocalDirectory) IsEmptyDirectory(verbose bool) (isEmpty bool, err error)
- func (l *LocalDirectory) IsLocalDirectory() (isLocalDirectory bool, err error)
- func (l *LocalDirectory) ListFilePaths(listOptions *parameteroptions.ListFileOptions) (filePathList []string, err error)
- func (l *LocalDirectory) ListFiles(options *parameteroptions.ListFileOptions) (files []File, err error)
- func (l *LocalDirectory) ListSubDirectories(listDirectoryOptions *parameteroptions.ListDirectoryOptions) (subDirectories []Directory, err error)
- func (l *LocalDirectory) ListSubDirectoriesAsAbsolutePaths(listDirectoryOptions *parameteroptions.ListDirectoryOptions) (subDirectoryPaths []string, err error)
- func (l *LocalDirectory) MustChmod(chmodOptions *parameteroptions.ChmodOptions)
- func (l *LocalDirectory) MustCopyContentToDirectory(destinationDir Directory, verbose bool)
- func (l *LocalDirectory) MustCopyContentToLocalDirectory(destDirectory *LocalDirectory, verbose bool)
- func (l *LocalDirectory) MustCreate(verbose bool)
- func (l *LocalDirectory) MustCreateFileInDirectory(verbose bool, path ...string) (createdFile File)
- func (l *LocalDirectory) MustCreateFilesInDirectory(filesToCreate []string, verbose bool) (createdFiles []File)
- func (l *LocalDirectory) MustCreateSubDirectory(subDirName string, verbose bool) (createdSubDir Directory)
- func (l *LocalDirectory) MustDelete(verbose bool)
- func (l *LocalDirectory) MustExists(verbose bool) (exists bool)
- func (l *LocalDirectory) MustGetBaseName() (baseName string)
- func (l *LocalDirectory) MustGetDirName() (dirName string)
- func (l *LocalDirectory) MustGetFileInDirectory(path ...string) (file File)
- func (l *LocalDirectory) MustGetFileInDirectoryAsLocalFile(filePath ...string) (localFile *LocalFile)
- func (l *LocalDirectory) MustGetHostDescription() (hostDescription string)
- func (l *LocalDirectory) MustGetLocalPath() (localPath string)
- func (l *LocalDirectory) MustGetParentDirectory() (parentDirectory Directory)
- func (l *LocalDirectory) MustGetPath() (dirPath string)
- func (l *LocalDirectory) MustGetSubDirectory(path ...string) (subDirectory Directory)
- func (l *LocalDirectory) MustGetSubDirectoryAndLocalPath(path ...string) (subDirectory Directory, subDirectoryPath string)
- func (l *LocalDirectory) MustIsEmptyDirectory(verbose bool) (isEmpty bool)
- func (l *LocalDirectory) MustIsLocalDirectory() (isLocalDirectory bool)
- func (l *LocalDirectory) MustListFilePaths(listOptions *parameteroptions.ListFileOptions) (filePathList []string)
- func (l *LocalDirectory) MustListFilePathsns(listOptions *parameteroptions.ListFileOptions) (filePathList []string)
- func (l *LocalDirectory) MustListFiles(options *parameteroptions.ListFileOptions) (files []File)
- func (l *LocalDirectory) MustListSubDirectories(listDirectoryOptions *parameteroptions.ListDirectoryOptions) (subDirectories []Directory)
- func (l *LocalDirectory) MustListSubDirectoriesAsAbsolutePaths(listDirectoryOptions *parameteroptions.ListDirectoryOptions) (subDirectoryPaths []string)
- func (l *LocalDirectory) MustSetLocalPath(localPath string)
- func (l *LocalDirectory) MustSubDirectoryExists(subDirName string, verbose bool) (subDirExists bool)
- func (l *LocalDirectory) SetLocalPath(localPath string) (err error)
- func (l *LocalDirectory) SubDirectoryExists(subDirName string, verbose bool) (subDirExists bool, err error)
- type LocalFile
- func GetLocalFileByFile(inputFile File) (localFile *LocalFile, err error)
- func GetLocalFileByPath(localPath string) (l *LocalFile, err error)
- func MustGetLocalFileByFile(inputFile File) (localFile *LocalFile)
- func MustGetLocalFileByPath(localPath string) (l *LocalFile)
- func MustNewLocalFileByPath(localPath string) (l *LocalFile)
- func NewLocalFile() (l *LocalFile)
- func NewLocalFileByPath(localPath string) (l *LocalFile, err error)
- func (l *LocalFile) AppendBytes(toWrite []byte, verbose bool) (err error)
- func (l *LocalFile) AppendString(toWrite string, verbose bool) (err error)
- func (l *LocalFile) Chmod(chmodOptions *parameteroptions.ChmodOptions) (err error)
- func (l *LocalFile) Chown(options *parameteroptions.ChownOptions) (err error)
- func (l *LocalFile) CopyToFile(destFile File, verbose bool) (err error)
- func (l *LocalFile) Create(verbose bool) (err error)
- func (l *LocalFile) Delete(verbose bool) (err error)
- func (l *LocalFile) Exists(verbose bool) (exists bool, err error)
- func (l *LocalFile) GetBaseName() (baseName string, err error)
- func (l *LocalFile) GetDeepCopy() (deepCopy File)
- func (l *LocalFile) GetHostDescription() (hostDescription string, err error)
- func (l *LocalFile) GetLocalPath() (path string, err error)
- func (l *LocalFile) GetLocalPathOrEmptyStringIfUnset() (localPath string, err error)
- func (l *LocalFile) GetParentDirectory() (parentDirectory Directory, err error)
- func (l *LocalFile) GetParentFileForBaseClassAsLocalFile() (parentAsLocalFile *LocalFile, err error)
- func (l *LocalFile) GetPath() (path string, err error)
- func (l *LocalFile) GetSizeBytes() (fileSizeBytes int64, err error)
- func (l *LocalFile) GetUriAsString() (uri string, err error)
- func (l *LocalFile) IsPathSet() (isSet bool)
- func (l *LocalFile) MoveToPath(path string, useSudo bool, verbose bool) (movedFile File, err error)
- func (l *LocalFile) MustAppendBytes(toWrite []byte, verbose bool)
- func (l *LocalFile) MustAppendString(toWrite string, verbose bool)
- func (l *LocalFile) MustChmod(chmodOptions *parameteroptions.ChmodOptions)
- func (l *LocalFile) MustChown(options *parameteroptions.ChownOptions)
- func (l *LocalFile) MustCopyToFile(destFile File, verbose bool)
- func (l *LocalFile) MustCreate(verbose bool)
- func (l *LocalFile) MustDelete(verbose bool)
- func (l *LocalFile) MustExists(verbose bool) (exists bool)
- func (l *LocalFile) MustGetBaseName() (baseName string)
- func (l *LocalFile) MustGetHostDescription() (hostDescription string)
- func (l *LocalFile) MustGetLocalPath() (path string)
- func (l *LocalFile) MustGetLocalPathOrEmptyStringIfUnset() (localPath string)
- func (l *LocalFile) MustGetParentDirectory() (parentDirectory Directory)
- func (l *LocalFile) MustGetParentFileForBaseClassAsLocalFile() (parentAsLocalFile *LocalFile)
- func (l *LocalFile) MustGetPath() (path string)
- func (l *LocalFile) MustGetSizeBytes() (fileSizeBytes int64)
- func (l *LocalFile) MustGetUriAsString() (uri string)
- func (l *LocalFile) MustMoveToPath(path string, useSudo bool, verbose bool) (movedFile File)
- func (l *LocalFile) MustReadAsBytes() (content []byte)
- func (l *LocalFile) MustReadFirstNBytes(numberOfBytesToRead int) (firstBytes []byte)
- func (l *LocalFile) MustSecurelyDelete(verbose bool)
- func (l *LocalFile) MustSetPath(path string)
- func (l *LocalFile) MustTruncate(newSizeBytes int64, verbose bool)
- func (l *LocalFile) MustWriteBytes(toWrite []byte, verbose bool)
- func (l *LocalFile) ReadAsBytes() (content []byte, err error)
- func (l *LocalFile) ReadFirstNBytes(numberOfBytesToRead int) (firstBytes []byte, err error)
- func (l *LocalFile) SecurelyDelete(verbose bool) (err error)
- func (l *LocalFile) SetPath(path string) (err error)
- func (l *LocalFile) Truncate(newSizeBytes int64, verbose bool) (err error)
- func (l *LocalFile) WriteBytes(toWrite []byte, verbose bool) (err error)
Constants ¶
This section is empty.
Variables ¶
var ErrFileBaseParentNotSet = errors.New("parent is not set")
Functions ¶
func MustReadFileAsString ¶
func MustWriteStringToFile ¶
func ReadFileAsString ¶
Types ¶
type CommandExecutorDirectory ¶
type CommandExecutorDirectory struct { DirectoryBase // contains filtered or unexported fields }
A CommandExecutorDirectory implements the functionality of a `Directory` by executing commands (like: test, stat, cat...).
The benefit of this apporach is an easy way to access directories on any remote system like VMs, Containers, Hosts... while it easy to chain like inside Container on VM behind Jumphost...
The downside of this is the poor performance and the possiblity to see in the process table which operations where done.
func GetCommandExecutorDirectoryByPath ¶
func GetCommandExecutorDirectoryByPath(commandExecutor commandexecutor.CommandExecutor, path string) (c *CommandExecutorDirectory, err error)
func GetLocalCommandExecutorDirectoryByPath ¶
func GetLocalCommandExecutorDirectoryByPath(path string) (c *CommandExecutorDirectory, err error)
func MustGetCommandExecutorDirectoryByPath ¶
func MustGetCommandExecutorDirectoryByPath(commandExecutor commandexecutor.CommandExecutor, path string) (c *CommandExecutorDirectory)
func MustGetLocalCommandExecutorDirectoryByPath ¶
func MustGetLocalCommandExecutorDirectoryByPath(path string) (c *CommandExecutorDirectory)
func MustNewCommandExecutorDirectory ¶
func MustNewCommandExecutorDirectory(commandExecutor commandexecutor.CommandExecutor) (c *CommandExecutorDirectory)
func NewCommandExecutorDirectory ¶
func NewCommandExecutorDirectory(commandExecutor commandexecutor.CommandExecutor) (c *CommandExecutorDirectory, err error)
func (*CommandExecutorDirectory) Chmod ¶
func (c *CommandExecutorDirectory) Chmod(chmodOptions *parameteroptions.ChmodOptions) (err error)
func (*CommandExecutorDirectory) CopyContentToDirectory ¶
func (c *CommandExecutorDirectory) CopyContentToDirectory(destinationDir Directory, verbose bool) (err error)
func (*CommandExecutorDirectory) Create ¶
func (c *CommandExecutorDirectory) Create(verbose bool) (err error)
func (*CommandExecutorDirectory) CreateSubDirectory ¶
func (c *CommandExecutorDirectory) CreateSubDirectory(subDirectoryName string, verbose bool) (createdSubDirectory Directory, err error)
func (*CommandExecutorDirectory) Delete ¶
func (c *CommandExecutorDirectory) Delete(verbose bool) (err error)
func (*CommandExecutorDirectory) Exists ¶
func (c *CommandExecutorDirectory) Exists(verbose bool) (exists bool, err error)
func (*CommandExecutorDirectory) GetBaseName ¶
func (c *CommandExecutorDirectory) GetBaseName() (baseName string, err error)
func (*CommandExecutorDirectory) GetCommandExecutor ¶
func (c *CommandExecutorDirectory) GetCommandExecutor() (commandExecutor commandexecutor.CommandExecutor, err error)
func (*CommandExecutorDirectory) GetCommandExecutorAndDirPath ¶
func (c *CommandExecutorDirectory) GetCommandExecutorAndDirPath() (commandExecutor commandexecutor.CommandExecutor, dirPath string, err error)
func (*CommandExecutorDirectory) GetCommandExecutorAndDirPathAndHostDescription ¶
func (c *CommandExecutorDirectory) GetCommandExecutorAndDirPathAndHostDescription() (commandExecutor commandexecutor.CommandExecutor, dirPath string, hostDescription string, err error)
func (*CommandExecutorDirectory) GetDirName ¶
func (c *CommandExecutorDirectory) GetDirName() (parentPath string, err error)
func (*CommandExecutorDirectory) GetDirPath ¶
func (c *CommandExecutorDirectory) GetDirPath() (dirPath string, err error)
func (*CommandExecutorDirectory) GetFileInDirectory ¶
func (c *CommandExecutorDirectory) GetFileInDirectory(pathToFile ...string) (file File, err error)
func (*CommandExecutorDirectory) GetHostDescription ¶
func (c *CommandExecutorDirectory) GetHostDescription() (hostDescription string, err error)
func (*CommandExecutorDirectory) GetLocalPath ¶
func (c *CommandExecutorDirectory) GetLocalPath() (localPath string, err error)
func (*CommandExecutorDirectory) GetParentDirectory ¶
func (c *CommandExecutorDirectory) GetParentDirectory() (parent Directory, err error)
func (*CommandExecutorDirectory) GetPath ¶
func (c *CommandExecutorDirectory) GetPath() (path string, err error)
func (*CommandExecutorDirectory) GetSubDirectory ¶
func (c *CommandExecutorDirectory) GetSubDirectory(path ...string) (subDirectory Directory, err error)
func (*CommandExecutorDirectory) IsLocalDirectory ¶
func (c *CommandExecutorDirectory) IsLocalDirectory() (isLocalDirectory bool, err error)
func (*CommandExecutorDirectory) ListFilePaths ¶
func (c *CommandExecutorDirectory) ListFilePaths(listFileOptions *parameteroptions.ListFileOptions) (filePaths []string, err error)
func (*CommandExecutorDirectory) ListFiles ¶
func (c *CommandExecutorDirectory) ListFiles(listFileOptions *parameteroptions.ListFileOptions) (files []File, err error)
func (*CommandExecutorDirectory) ListSubDirectories ¶
func (c *CommandExecutorDirectory) ListSubDirectories(options *parameteroptions.ListDirectoryOptions) (subDirectories []Directory, err error)
func (*CommandExecutorDirectory) MustChmod ¶
func (c *CommandExecutorDirectory) MustChmod(chmodOptions *parameteroptions.ChmodOptions)
func (*CommandExecutorDirectory) MustCopyContentToDirectory ¶
func (c *CommandExecutorDirectory) MustCopyContentToDirectory(destinationDir Directory, verbose bool)
func (*CommandExecutorDirectory) MustCreate ¶
func (c *CommandExecutorDirectory) MustCreate(verbose bool)
func (*CommandExecutorDirectory) MustCreateSubDirectory ¶
func (c *CommandExecutorDirectory) MustCreateSubDirectory(subDirectoryName string, verbose bool) (createdSubDirectory Directory)
func (*CommandExecutorDirectory) MustDelete ¶
func (c *CommandExecutorDirectory) MustDelete(verbose bool)
func (*CommandExecutorDirectory) MustExists ¶
func (c *CommandExecutorDirectory) MustExists(verbose bool) (exists bool)
func (*CommandExecutorDirectory) MustGetBaseName ¶
func (c *CommandExecutorDirectory) MustGetBaseName() (baseName string)
func (*CommandExecutorDirectory) MustGetCommandExecutor ¶
func (c *CommandExecutorDirectory) MustGetCommandExecutor() (commandExecutor commandexecutor.CommandExecutor)
func (*CommandExecutorDirectory) MustGetCommandExecutorAndDirPath ¶
func (c *CommandExecutorDirectory) MustGetCommandExecutorAndDirPath() (commandExecutor commandexecutor.CommandExecutor, dirPath string)
func (*CommandExecutorDirectory) MustGetCommandExecutorAndDirPathAndHostDescription ¶
func (c *CommandExecutorDirectory) MustGetCommandExecutorAndDirPathAndHostDescription() (commandExecutor commandexecutor.CommandExecutor, dirPath string, hostDescription string)
func (*CommandExecutorDirectory) MustGetDirName ¶
func (c *CommandExecutorDirectory) MustGetDirName() (dirName string)
func (*CommandExecutorDirectory) MustGetDirPath ¶
func (c *CommandExecutorDirectory) MustGetDirPath() (dirPath string)
func (*CommandExecutorDirectory) MustGetFileInDirectory ¶
func (c *CommandExecutorDirectory) MustGetFileInDirectory(pathToFile ...string) (file File)
func (*CommandExecutorDirectory) MustGetHostDescription ¶
func (c *CommandExecutorDirectory) MustGetHostDescription() (hostDescription string)
func (*CommandExecutorDirectory) MustGetLocalPath ¶
func (c *CommandExecutorDirectory) MustGetLocalPath() (localPath string)
func (*CommandExecutorDirectory) MustGetParentDirectory ¶
func (c *CommandExecutorDirectory) MustGetParentDirectory() (parent Directory)
func (*CommandExecutorDirectory) MustGetPath ¶
func (c *CommandExecutorDirectory) MustGetPath() (path string)
func (*CommandExecutorDirectory) MustGetSubDirectory ¶
func (c *CommandExecutorDirectory) MustGetSubDirectory(path ...string) (subDirectory Directory)
func (*CommandExecutorDirectory) MustIsLocalDirectory ¶
func (c *CommandExecutorDirectory) MustIsLocalDirectory() (isLocalDirectory bool)
func (*CommandExecutorDirectory) MustListFilePaths ¶
func (c *CommandExecutorDirectory) MustListFilePaths(listFileOptions *parameteroptions.ListFileOptions) (filePaths []string)
func (*CommandExecutorDirectory) MustListFiles ¶
func (c *CommandExecutorDirectory) MustListFiles(listFileOptions *parameteroptions.ListFileOptions) (files []File)
func (*CommandExecutorDirectory) MustListSubDirectories ¶
func (c *CommandExecutorDirectory) MustListSubDirectories(options *parameteroptions.ListDirectoryOptions) (subDirectories []Directory)
func (*CommandExecutorDirectory) MustSetCommandExecutor ¶
func (c *CommandExecutorDirectory) MustSetCommandExecutor(commandExecutor commandexecutor.CommandExecutor)
func (*CommandExecutorDirectory) MustSetDirPath ¶
func (c *CommandExecutorDirectory) MustSetDirPath(dirPath string)
func (*CommandExecutorDirectory) SetCommandExecutor ¶
func (c *CommandExecutorDirectory) SetCommandExecutor(commandExecutor commandexecutor.CommandExecutor) (err error)
func (*CommandExecutorDirectory) SetDirPath ¶
func (c *CommandExecutorDirectory) SetDirPath(dirPath string) (err error)
type CommandExecutorFile ¶
type CommandExecutorFile struct { FileBase // contains filtered or unexported fields }
A CommandExecutorFile implements the functionality of a `File` by executing commands (like: test, stat, cat...).
The benefit of this apporach is an easy way to access files on any remote system like VMs, Containers, Hosts... while it easy to chain like inside Container on VM behind Jumphost...
The downside of this is the poor performance and the possiblity to see in the process table which operations where done.
func GetCommandExecutorFileByPath ¶
func GetCommandExecutorFileByPath(commandExector commandexecutor.CommandExecutor, path string) (commandExecutorFile *CommandExecutorFile, err error)
func GetLocalCommandExecutorFileByFile ¶
func GetLocalCommandExecutorFileByFile(file File, verbose bool) (commandExecutorFile *CommandExecutorFile, err error)
func GetLocalCommandExecutorFileByPath ¶
func GetLocalCommandExecutorFileByPath(localPath string) (commandExecutorFile *CommandExecutorFile, err error)
func MustGetCommandExecutorFileByPath ¶
func MustGetCommandExecutorFileByPath(commandExector commandexecutor.CommandExecutor, path string) (commandExecutorFile *CommandExecutorFile)
func MustGetLocalCommandExecutorFileByFile ¶
func MustGetLocalCommandExecutorFileByFile(file File, verbose bool) (commandExecutorFile *CommandExecutorFile)
func MustGetLocalCommandExecutorFileByPath ¶
func MustGetLocalCommandExecutorFileByPath(localPath string) (commandExecutorFile *CommandExecutorFile)
func NewCommandExecutorFile ¶
func NewCommandExecutorFile() (c *CommandExecutorFile)
func (*CommandExecutorFile) AppendBytes ¶
func (c *CommandExecutorFile) AppendBytes(toWrite []byte, verbose bool) (err error)
func (*CommandExecutorFile) AppendString ¶
func (c *CommandExecutorFile) AppendString(toWrite string, verbose bool) (err error)
func (*CommandExecutorFile) Chmod ¶
func (c *CommandExecutorFile) Chmod(chmodOptions *parameteroptions.ChmodOptions) (err error)
func (*CommandExecutorFile) Chown ¶
func (c *CommandExecutorFile) Chown(options *parameteroptions.ChownOptions) (err error)
func (*CommandExecutorFile) CopyToFile ¶
func (c *CommandExecutorFile) CopyToFile(destFile File, verbose bool) (err error)
func (*CommandExecutorFile) Create ¶
func (c *CommandExecutorFile) Create(verbose bool) (err error)
func (*CommandExecutorFile) Delete ¶
func (c *CommandExecutorFile) Delete(verbose bool) (err error)
func (*CommandExecutorFile) Exists ¶
func (c *CommandExecutorFile) Exists(verbose bool) (exists bool, err error)
func (*CommandExecutorFile) GetBaseName ¶
func (c *CommandExecutorFile) GetBaseName() (baseName string, err error)
func (*CommandExecutorFile) GetCommandExecutor ¶
func (c *CommandExecutorFile) GetCommandExecutor() (commandExecutor commandexecutor.CommandExecutor, err error)
func (*CommandExecutorFile) GetCommandExecutorAndFilePath ¶
func (c *CommandExecutorFile) GetCommandExecutorAndFilePath() (commandExecutor commandexecutor.CommandExecutor, filePath string, err error)
func (*CommandExecutorFile) GetCommandExecutorAndFilePathAndHostDescription ¶
func (c *CommandExecutorFile) GetCommandExecutorAndFilePathAndHostDescription() (commandExecutor commandexecutor.CommandExecutor, filePath string, hostDescription string, err error)
func (*CommandExecutorFile) GetDeepCopy ¶
func (c *CommandExecutorFile) GetDeepCopy() (deepCopy File)
func (*CommandExecutorFile) GetFilePath ¶
func (c *CommandExecutorFile) GetFilePath() (filePath string, err error)
func (*CommandExecutorFile) GetHostDescription ¶
func (c *CommandExecutorFile) GetHostDescription() (hostDescription string, err error)
func (*CommandExecutorFile) GetLocalPath ¶
func (c *CommandExecutorFile) GetLocalPath() (localPath string, err error)
func (*CommandExecutorFile) GetLocalPathOrEmptyStringIfUnset ¶
func (c *CommandExecutorFile) GetLocalPathOrEmptyStringIfUnset() (localPath string, err error)
func (*CommandExecutorFile) GetParentDirectory ¶
func (c *CommandExecutorFile) GetParentDirectory() (parentDirectory Directory, err error)
func (*CommandExecutorFile) GetPath ¶
func (c *CommandExecutorFile) GetPath() (path string, err error)
func (*CommandExecutorFile) GetPathAndHostDescription ¶
func (c *CommandExecutorFile) GetPathAndHostDescription() (path string, hostDescription string, err error)
func (*CommandExecutorFile) GetSizeBytes ¶
func (c *CommandExecutorFile) GetSizeBytes() (fileSize int64, err error)
func (*CommandExecutorFile) GetUriAsString ¶
func (c *CommandExecutorFile) GetUriAsString() (uri string, err error)
func (*CommandExecutorFile) IsRunningOnLocalhost ¶
func (c *CommandExecutorFile) IsRunningOnLocalhost() (isRunningOnLocalhost bool, err error)
func (*CommandExecutorFile) MoveToPath ¶
func (*CommandExecutorFile) MustAppendBytes ¶
func (c *CommandExecutorFile) MustAppendBytes(toWrite []byte, verbose bool)
func (*CommandExecutorFile) MustAppendString ¶
func (c *CommandExecutorFile) MustAppendString(toWrite string, verbose bool)
func (*CommandExecutorFile) MustChmod ¶
func (c *CommandExecutorFile) MustChmod(chmodOptions *parameteroptions.ChmodOptions)
func (*CommandExecutorFile) MustChown ¶
func (c *CommandExecutorFile) MustChown(options *parameteroptions.ChownOptions)
func (*CommandExecutorFile) MustCopyToFile ¶
func (c *CommandExecutorFile) MustCopyToFile(destFile File, verbose bool)
func (*CommandExecutorFile) MustCreate ¶
func (c *CommandExecutorFile) MustCreate(verbose bool)
func (*CommandExecutorFile) MustDelete ¶
func (c *CommandExecutorFile) MustDelete(verbose bool)
func (*CommandExecutorFile) MustExists ¶
func (c *CommandExecutorFile) MustExists(verbose bool) (exist bool)
func (*CommandExecutorFile) MustGetBaseName ¶
func (c *CommandExecutorFile) MustGetBaseName() (baseName string)
func (*CommandExecutorFile) MustGetCommandExecutor ¶
func (c *CommandExecutorFile) MustGetCommandExecutor() (commandExecutor commandexecutor.CommandExecutor)
func (*CommandExecutorFile) MustGetCommandExecutorAndFilePath ¶
func (c *CommandExecutorFile) MustGetCommandExecutorAndFilePath() (commandExecutor commandexecutor.CommandExecutor, filePath string)
func (*CommandExecutorFile) MustGetCommandExecutorAndFilePathAndHostDescription ¶
func (c *CommandExecutorFile) MustGetCommandExecutorAndFilePathAndHostDescription() (commandExecutor commandexecutor.CommandExecutor, filePath string, hostDescription string)
func (*CommandExecutorFile) MustGetFilePath ¶
func (c *CommandExecutorFile) MustGetFilePath() (filePath string)
func (*CommandExecutorFile) MustGetHostDescription ¶
func (c *CommandExecutorFile) MustGetHostDescription() (hostDescription string)
func (*CommandExecutorFile) MustGetLocalPath ¶
func (c *CommandExecutorFile) MustGetLocalPath() (localPath string)
func (*CommandExecutorFile) MustGetLocalPathOrEmptyStringIfUnset ¶
func (c *CommandExecutorFile) MustGetLocalPathOrEmptyStringIfUnset() (localPath string)
func (*CommandExecutorFile) MustGetParentDirectory ¶
func (c *CommandExecutorFile) MustGetParentDirectory() (parentDirectory Directory)
func (*CommandExecutorFile) MustGetPath ¶
func (c *CommandExecutorFile) MustGetPath() (path string)
func (*CommandExecutorFile) MustGetPathAndHostDescription ¶
func (c *CommandExecutorFile) MustGetPathAndHostDescription() (path string, hostDescription string)
func (*CommandExecutorFile) MustGetSizeBytes ¶
func (c *CommandExecutorFile) MustGetSizeBytes() (fileSize int64)
func (*CommandExecutorFile) MustGetUriAsString ¶
func (c *CommandExecutorFile) MustGetUriAsString() (uri string)
func (*CommandExecutorFile) MustIsRunningOnLocalhost ¶
func (c *CommandExecutorFile) MustIsRunningOnLocalhost() (isRunningOnLocalhost bool)
func (*CommandExecutorFile) MustMoveToPath ¶
func (c *CommandExecutorFile) MustMoveToPath(path string, useSudo bool, verbose bool) (movedFile File)
func (*CommandExecutorFile) MustReadAsBytes ¶
func (c *CommandExecutorFile) MustReadAsBytes() (content []byte)
func (*CommandExecutorFile) MustReadFirstNBytes ¶
func (c *CommandExecutorFile) MustReadFirstNBytes(numberOfBytesToRead int) (firstBytes []byte)
func (*CommandExecutorFile) MustSecurelyDelete ¶
func (c *CommandExecutorFile) MustSecurelyDelete(verbose bool)
func (*CommandExecutorFile) MustSetCommandExecutor ¶
func (c *CommandExecutorFile) MustSetCommandExecutor(commandExecutor commandexecutor.CommandExecutor)
func (*CommandExecutorFile) MustSetFilePath ¶
func (c *CommandExecutorFile) MustSetFilePath(filePath string)
func (*CommandExecutorFile) MustTruncate ¶
func (c *CommandExecutorFile) MustTruncate(newSizeBytes int64, verbose bool)
func (*CommandExecutorFile) MustWriteBytes ¶
func (c *CommandExecutorFile) MustWriteBytes(toWrite []byte, verbose bool)
func (*CommandExecutorFile) ReadAsBytes ¶
func (c *CommandExecutorFile) ReadAsBytes() (content []byte, err error)
func (*CommandExecutorFile) ReadFirstNBytes ¶
func (c *CommandExecutorFile) ReadFirstNBytes(numberOfBytesToRead int) (firstBytes []byte, err error)
func (*CommandExecutorFile) SecurelyDelete ¶
func (c *CommandExecutorFile) SecurelyDelete(verbose bool) (err error)
func (*CommandExecutorFile) SetCommandExecutor ¶
func (c *CommandExecutorFile) SetCommandExecutor(commandExecutor commandexecutor.CommandExecutor) (err error)
func (*CommandExecutorFile) SetFilePath ¶
func (c *CommandExecutorFile) SetFilePath(filePath string) (err error)
func (*CommandExecutorFile) Truncate ¶
func (c *CommandExecutorFile) Truncate(newSizeBytes int64, verbose bool) (err error)
func (*CommandExecutorFile) WriteBytes ¶
func (c *CommandExecutorFile) WriteBytes(toWrite []byte, verbose bool) (err error)
type DirectoriesService ¶
type DirectoriesService struct { }
func Directories ¶
func Directories() (d *DirectoriesService)
func NewDirectoriesService ¶
func NewDirectoriesService() (d *DirectoriesService)
func (*DirectoriesService) CreateLocalDirectoryByPath ¶
func (d *DirectoriesService) CreateLocalDirectoryByPath(path string, verbose bool) (l Directory, err error)
func (*DirectoriesService) MustCreateLocalDirectoryByPath ¶
func (d *DirectoriesService) MustCreateLocalDirectoryByPath(path string, verbose bool) (l Directory)
type Directory ¶
type Directory interface { Chmod(chmodOptions *parameteroptions.ChmodOptions) (err error) CopyContentToDirectory(destinationDir Directory, verbose bool) (err error) Create(verbose bool) (err error) CreateSubDirectory(subDirectoryName string, verbose bool) (createdSubDirectory Directory, err error) Delete(verbose bool) (err error) Exists(verbose bool) (exists bool, err error) GetBaseName() (baseName string, err error) GetDirName() (dirName string, err error) GetFileInDirectory(pathToFile ...string) (file File, err error) GetHostDescription() (hostDescription string, err error) // Returns the path on the local machine. If the path is not available locally an error is returned. GetLocalPath() (localPath string, err error) GetParentDirectory() (parentDirectory Directory, err error) // Returns the absolute path to the file without any indication of the host. GetPath() (dirPath string, err error) // TODO rename GetSubDirectory with GetDirectoryByPath to make it consistent. GetSubDirectory(path ...string) (subDirectory Directory, err error) IsLocalDirectory() (isLocalDirectory bool, err error) ListFiles(listFileOptions *parameteroptions.ListFileOptions) (files []File, err error) ListSubDirectories(options *parameteroptions.ListDirectoryOptions) (subDirectories []Directory, err error) MustChmod(chmodOptions *parameteroptions.ChmodOptions) MustCopyContentToDirectory(destinationDir Directory, verbose bool) MustCreate(verbose bool) MustCreateSubDirectory(subDirectoryName string, verbose bool) (createdSubDirectory Directory) MustDelete(verbose bool) MustExists(verbose bool) (exists bool) MustGetBaseName() (baseName string) MustGetDirName() (dirName string) MustGetFileInDirectory(pathToFile ...string) (file File) MustGetHostDescription() (hostDescription string) // Returns the path on the local machine. If the path is not available locally an error is returned. MustGetLocalPath() (localPath string) MustGetParentDirectory() (parentDirectory Directory) // Returns the absolute path to the file without any indication of the host. MustGetPath() (dirPath string) MustGetSubDirectory(path ...string) (subDirectory Directory) MustIsLocalDirectory() (isLocalDirectory bool) MustListFiles(listFileOptions *parameteroptions.ListFileOptions) (files []File) MustListSubDirectories(options *parameteroptions.ListDirectoryOptions) (subDirectories []Directory) // All methods below this line can be implemented by embedding the `DirectoryBase` struct: CheckExists(verbose bool) (err error) CreateFileInDirectory(verbose bool, path ...string) (createdFile File, err error) GetFilePathInDirectory(path ...string) (filePath string, err error) GetPathAndHostDescription() (dirPath string, hostDescription string, err error) DeleteFilesMatching(listFileOptons *parameteroptions.ListFileOptions) (err error) FileInDirectoryExists(verbose bool, path ...string) (exists bool, err error) ListFilePaths(listFileOptions *parameteroptions.ListFileOptions) (filePaths []string, err error) ListSubDirectoryPaths(options *parameteroptions.ListDirectoryOptions) (subDirectoryPaths []string, err error) MustCheckExists(verbose bool) MustCreateFileInDirectory(verbose bool, path ...string) (createdFile File) MustDeleteFilesMatching(listFileOptons *parameteroptions.ListFileOptions) MustGetFilePathInDirectory(path ...string) (filePath string) MustGetPathAndHostDescription() (pathString string, hostDescription string) MustFileInDirectoryExists(verbose bool, path ...string) (exists bool) MustListFilePaths(listFileOptions *parameteroptions.ListFileOptions) (filePaths []string) MustListSubDirectoryPaths(options *parameteroptions.ListDirectoryOptions) (subDirectoryPaths []string) MustReadFileInDirectoryAsInt64(path ...string) (content int64) MustReadFileInDirectoryAsLines(path ...string) (content []string) MustReadFileInDirectoryAsString(path ...string) (content string) MustReadFirstLineOfFileInDirectoryAsString(path ...string) (firstLine string) MustWriteStringToFileInDirectory(content string, verbose bool, path ...string) (writtenFile File) ReadFileInDirectoryAsInt64(path ...string) (content int64, err error) ReadFileInDirectoryAsLines(path ...string) (content []string, err error) ReadFileInDirectoryAsString(path ...string) (content string, err error) ReadFirstLineOfFileInDirectoryAsString(path ...string) (firstLine string, err error) WriteStringToFileInDirectory(content string, verbose bool, path ...string) (writtenFile File, err error) }
type DirectoryBase ¶
type DirectoryBase struct {
// contains filtered or unexported fields
}
func NewDirectoryBase ¶
func NewDirectoryBase() (d *DirectoryBase)
func (*DirectoryBase) CheckExists ¶
func (d *DirectoryBase) CheckExists(verbose bool) (err error)
func (*DirectoryBase) CreateFileInDirectory ¶
func (d *DirectoryBase) CreateFileInDirectory(verbose bool, path ...string) (createdFile File, err error)
func (*DirectoryBase) CreateFileInDirectoryFromString ¶
func (*DirectoryBase) DeleteFilesMatching ¶
func (d *DirectoryBase) DeleteFilesMatching(listFileOptions *parameteroptions.ListFileOptions) (err error)
func (*DirectoryBase) FileInDirectoryExists ¶
func (d *DirectoryBase) FileInDirectoryExists(verbose bool, path ...string) (fileExists bool, err error)
func (*DirectoryBase) GetFilePathInDirectory ¶
func (d *DirectoryBase) GetFilePathInDirectory(path ...string) (filePath string, err error)
func (*DirectoryBase) GetParentDirectoryForBaseClass ¶
func (d *DirectoryBase) GetParentDirectoryForBaseClass() (parentDirectoryForBaseClass Directory, err error)
func (*DirectoryBase) GetPathAndHostDescription ¶
func (d *DirectoryBase) GetPathAndHostDescription() (path string, hostDescription string, err error)
func (*DirectoryBase) ListFilePaths ¶
func (d *DirectoryBase) ListFilePaths(listFileOptions *parameteroptions.ListFileOptions) (filePaths []string, err error)
func (*DirectoryBase) ListSubDirectoryPaths ¶
func (d *DirectoryBase) ListSubDirectoryPaths(options *parameteroptions.ListDirectoryOptions) (subDirectoryPaths []string, err error)
func (*DirectoryBase) MustCheckExists ¶
func (d *DirectoryBase) MustCheckExists(verbose bool)
func (*DirectoryBase) MustCreateFileInDirectory ¶
func (d *DirectoryBase) MustCreateFileInDirectory(verbose bool, path ...string) (createdFile File)
func (*DirectoryBase) MustCreateFileInDirectoryFromString ¶
func (d *DirectoryBase) MustCreateFileInDirectoryFromString(content string, verbose bool, pathToCreate ...string) (createdFile File)
func (*DirectoryBase) MustDeleteFilesMatching ¶
func (d *DirectoryBase) MustDeleteFilesMatching(listFileOptions *parameteroptions.ListFileOptions)
func (*DirectoryBase) MustFileInDirectoryExists ¶
func (d *DirectoryBase) MustFileInDirectoryExists(verbose bool, path ...string) (fileExists bool)
func (*DirectoryBase) MustGetFilePathInDirectory ¶
func (d *DirectoryBase) MustGetFilePathInDirectory(path ...string) (filePath string)
func (*DirectoryBase) MustGetParentDirectoryForBaseClass ¶
func (d *DirectoryBase) MustGetParentDirectoryForBaseClass() (parentDirectoryForBaseClass Directory)
func (*DirectoryBase) MustGetPathAndHostDescription ¶
func (d *DirectoryBase) MustGetPathAndHostDescription() (path string, hostDescription string)
func (*DirectoryBase) MustListFilePaths ¶
func (d *DirectoryBase) MustListFilePaths(listFileOptions *parameteroptions.ListFileOptions) (filePaths []string)
func (*DirectoryBase) MustListSubDirectoryPaths ¶
func (d *DirectoryBase) MustListSubDirectoryPaths(options *parameteroptions.ListDirectoryOptions) (subDirectoryPaths []string)
func (*DirectoryBase) MustReadFileInDirectoryAsInt64 ¶
func (d *DirectoryBase) MustReadFileInDirectoryAsInt64(path ...string) (value int64)
func (*DirectoryBase) MustReadFileInDirectoryAsLines ¶
func (d *DirectoryBase) MustReadFileInDirectoryAsLines(path ...string) (content []string)
func (*DirectoryBase) MustReadFileInDirectoryAsString ¶
func (d *DirectoryBase) MustReadFileInDirectoryAsString(path ...string) (content string)
func (*DirectoryBase) MustReadFirstLineOfFileInDirectoryAsString ¶
func (d *DirectoryBase) MustReadFirstLineOfFileInDirectoryAsString(path ...string) (firstLine string)
func (*DirectoryBase) MustSetParentDirectoryForBaseClass ¶
func (d *DirectoryBase) MustSetParentDirectoryForBaseClass(parentDirectoryForBaseClass Directory)
func (*DirectoryBase) MustWriteBytesToFile ¶
func (d *DirectoryBase) MustWriteBytesToFile(content []byte, verbose bool, path ...string) (writtenFile File)
func (*DirectoryBase) MustWriteStringToFileInDirectory ¶
func (d *DirectoryBase) MustWriteStringToFileInDirectory(content string, verbose bool, path ...string) (writtenFile File)
func (*DirectoryBase) ReadFileInDirectoryAsInt64 ¶
func (d *DirectoryBase) ReadFileInDirectoryAsInt64(path ...string) (value int64, err error)
func (*DirectoryBase) ReadFileInDirectoryAsLines ¶
func (d *DirectoryBase) ReadFileInDirectoryAsLines(path ...string) (content []string, err error)
func (*DirectoryBase) ReadFileInDirectoryAsString ¶
func (d *DirectoryBase) ReadFileInDirectoryAsString(path ...string) (content string, err error)
func (*DirectoryBase) ReadFirstLineOfFileInDirectoryAsString ¶
func (d *DirectoryBase) ReadFirstLineOfFileInDirectoryAsString(path ...string) (firstLine string, err error)
func (*DirectoryBase) SetParentDirectoryForBaseClass ¶
func (d *DirectoryBase) SetParentDirectoryForBaseClass(parentDirectoryForBaseClass Directory) (err error)
func (*DirectoryBase) WriteBytesToFile ¶
func (*DirectoryBase) WriteStringToFileInDirectory ¶
func (d *DirectoryBase) WriteStringToFileInDirectory(content string, verbose bool, path ...string) (writtenFile File, err error)
TODO: Rename to WriteStringtoFile( to make it more generic. This renaming is needed to bring GitRepository and Directory together.
type File ¶
type File interface { AppendBytes(toWrite []byte, verbose bool) (err error) AppendString(toWrite string, verbose bool) (err error) Chmod(options *parameteroptions.ChmodOptions) (err error) Chown(options *parameteroptions.ChownOptions) (err error) CopyToFile(destFile File, verbose bool) (err error) Create(verbose bool) (err error) Delete(verbose bool) (err error) Exists(verbose bool) (exists bool, err error) GetBaseName() (baseName string, err error) GetDeepCopy() (deepCopy File) GetHostDescription() (hostDescription string, err error) GetLocalPath() (localPath string, err error) GetLocalPathOrEmptyStringIfUnset() (localPath string, err error) GetParentDirectory() (parentDirectory Directory, err error) GetPath() (path string, err error) GetSizeBytes() (fileSize int64, err error) GetUriAsString() (uri string, err error) MoveToPath(destPath string, useSudo bool, verbose bool) (movedFile File, err error) MustAppendBytes(toWrtie []byte, verbose bool) MustAppendString(toWrtie string, verbose bool) MustChmod(options *parameteroptions.ChmodOptions) MustChown(options *parameteroptions.ChownOptions) MustCopyToFile(destFile File, verbose bool) MustCreate(verbose bool) MustDelete(verbose bool) MustExists(verbose bool) (exists bool) MustGetBaseName() (baseName string) MustGetHostDescription() (hostDescription string) MustGetLocalPath() (localPath string) MustGetLocalPathOrEmptyStringIfUnset() (localPath string) MustGetPath() (path string) MustGetParentDirectory() (parentDirectory Directory) MustGetSizeBytes() (fileSize int64) MustGetUriAsString() (uri string) MustMoveToPath(destPath string, useSudo bool, verbose bool) (movedFile File) MustReadAsBytes() (content []byte) MustSecurelyDelete(verbose bool) MustTruncate(newSizeBytes int64, verbose bool) MustWriteBytes(toWrite []byte, verbose bool) ReadAsBytes() (content []byte, err error) SecurelyDelete(verbose bool) (err error) Truncate(newSizeBytes int64, verbose bool) (err error) WriteBytes(toWrite []byte, verbose bool) (err error) // All methods below this line can be implemented by embedding the `FileBase` struct: AppendLine(line string, verbose bool) (err error) CheckIsLocalFile(verbose bool) (err error) ContainsLine(line string) (containsLine bool, err error) CreateParentDirectory(verbose bool) (err error) EnsureLineInFile(line string, verbose bool) (err error) EnsureEndsWithLineBreak(verbose bool) (err error) GetCreationDateByFileName(verbose bool) (creationDate *time.Time, err error) GetFileTypeDescription(verbose bool) (fileTypeDescription string, err error) GetMimeType(verbose bool) (mimeType string, err error) GetNumberOfLinesWithPrefix(prefix string, trimLines bool) (nLines int, err error) GetNumberOfNonEmptyLines() (nLines int, err error) GetParentDirectoryPath() (parentDirectoryPath string, err error) GetPathAndHostDescription() (path string, hostDescription string, err error) GetSha256Sum() (sha256sum string, err error) GetTextBlocks(verbose bool) (textBlocks []string, err error) GetValueAsInt(key string) (value int, err error) GetValueAsString(key string) (value string, err error) IsContentEqualByComparingSha256Sum(other File, verbose bool) (isMatching bool, err error) IsEmptyFile() (isEmpty bool, err error) IsLocalFile(verbose bool) (isLocalFile bool, err error) IsMatchingSha256Sum(sha256sum string) (isMatching bool, err error) IsPgpEncrypted(verbose bool) (isPgpEncrypted bool, err error) IsYYYYmmdd_HHMMSSPrefix() (hasDatePrefix bool, err error) MustAppendLine(line string, verbose bool) MustCheckIsLocalFile(verbose bool) MustContainsLine(line string) (containsLine bool) MustCreateParentDirectory(verbose bool) MustEnsureEndsWithLineBreak(verbose bool) MustEnsureLineInFile(line string, verbose bool) MustGetCreationDateByFileName(verbose bool) (creationDate *time.Time) MustGetFileTypeDescription(verbose bool) (fileTypeDescription string) MustGetMimeType(verbose bool) (mimeType string) MustGetNumberOfLinesWithPrefix(prefix string, trimLines bool) (nLines int) MustGetNumberOfNonEmptyLines() (nLines int) MustGetParentDirectoryPath() (parentDirectoryPath string) MustGetPathAndHostDescription() (path string, hostDescription string) MustGetSha256Sum() (sha256sum string) MustGetTextBlocks(verbose bool) (textBlocks []string) MustGetValueAsInt(key string) (value int) MustGetValueAsString(key string) (value string) MustIsContentEqualByComparingSha256Sum(other File, verbose bool) (isMatching bool) MustIsEmptyFile() (isEmpty bool) MustIsLocalFile(verbose bool) (isLocalFile bool) MustIsMatchingSha256Sum(sha256sum string) (isMatching bool) MustIsPgpEncrypted(verbose bool) (isPgpEncrypted bool) MustIsYYYYmmdd_HHMMSSPrefix() (hasDatePrefix bool) MustPrintContentOnStdout() MustReadAsBool() (content bool) MustReadAsFloat64() (content float64) MustReadAsInt() (content int) MustReadAsInt64() (content int64) MustReadAsLines() (contentLines []string) MustReadAsLinesWithoutComments() (contentLines []string) MustReadAsTimeTime() (time *time.Time) MustReadAsString() (content string) MustReadFirstLine() (firstLine string) MustReadFirstLineAndTrimSpace() (firstLine string) MustReadLastCharAsString() (lastChar string) MustReadFirstNBytes(numberOfBytesToRead int) (firstBytes []byte) MustRemoveLinesWithPrefix(prefix string, verbose bool) MustReplaceLineAfterLine(lineToFind string, replaceLineAfterWith string, verbose bool) (changeSummary *changesummary.ChangeSummary) MustSortBlocksInFile(verbose bool) MustTrimSpacesAtBeginningOfFile(verbose bool) MustWriteInt64(toWrite int64, verbose bool) MustWriteLines(linesToWrite []string, verbose bool) MustWriteString(content string, verbose bool) MustWriteTextBlocks(textBlocks []string, verose bool) PrintContentOnStdout() (err error) ReadAsBool() (content bool, err error) ReadAsFloat64() (content float64, err error) ReadAsInt() (content int, err error) ReadAsInt64() (content int64, err error) ReadAsLines() (contentLines []string, err error) ReadAsLinesWithoutComments() (contentLines []string, err error) ReadAsString() (content string, err error) ReadAsTimeTime() (time *time.Time, err error) ReadFirstLine() (firstLine string, err error) ReadFirstNBytes(numberOfBytesToRead int) (firstBytes []byte, err error) ReadFirstLineAndTrimSpace() (firstLine string, err error) ReadLastCharAsString() (lastChar string, err error) RemoveLinesWithPrefix(prefix string, verbose bool) (err error) ReplaceLineAfterLine(lineToFind string, replaceLineAfterWith string, verbose bool) (changeSummary *changesummary.ChangeSummary, err error) SortBlocksInFile(verbose bool) (err error) TrimSpacesAtBeginningOfFile(verbose bool) (err error) WriteInt64(toWrite int64, verboe bool) (err error) WriteLines(linesToWrite []string, verbose bool) (err error) WriteString(content string, verbose bool) (err error) WriteTextBlocks(textBlocks []string, verbose bool) (err error) }
A File represents any kind of file regardless if a local file or a remote file.
func MustGetFileByOsFile ¶
type FileBase ¶
type FileBase struct {
// contains filtered or unexported fields
}
This is the base for `File` providing most convenience functions for file operations.
func NewFileBase ¶
func NewFileBase() (f *FileBase)
func (*FileBase) CheckIsLocalFile ¶
func (*FileBase) ContainsLine ¶
func (*FileBase) CreateParentDirectory ¶
func (*FileBase) EnsureEndsWithLineBreak ¶
func (*FileBase) EnsureLineInFile ¶
func (*FileBase) GetCreationDateByFileName ¶
func (*FileBase) GetFileTypeDescription ¶
func (*FileBase) GetMimeType ¶
func (*FileBase) GetNumberOfLinesWithPrefix ¶
func (*FileBase) GetNumberOfNonEmptyLines ¶
func (*FileBase) GetParentDirectoryPath ¶
func (*FileBase) GetParentFileForBaseClass ¶
func (*FileBase) GetPathAndHostDescription ¶
func (*FileBase) GetSha256Sum ¶
func (*FileBase) GetTextBlocks ¶
func (*FileBase) GetValueAsInt ¶
func (*FileBase) GetValueAsString ¶
func (*FileBase) IsContentEqualByComparingSha256Sum ¶
func (*FileBase) IsEmptyFile ¶
func (*FileBase) IsLocalFile ¶
Returns true if the file is a file on the local host.
If a file can return a local path the assumption is it is a local file.
func (*FileBase) IsMatchingSha256Sum ¶
func (*FileBase) IsPgpEncrypted ¶
func (*FileBase) IsYYYYmmdd_HHMMSSPrefix ¶
func (*FileBase) MustAppendLine ¶
func (*FileBase) MustCheckIsLocalFile ¶
func (*FileBase) MustContainsLine ¶
func (*FileBase) MustCreateParentDirectory ¶
func (*FileBase) MustEnsureEndsWithLineBreak ¶
func (*FileBase) MustEnsureLineInFile ¶
func (*FileBase) MustGetCreationDateByFileName ¶
func (*FileBase) MustGetFileTypeDescription ¶
func (*FileBase) MustGetMimeType ¶
func (*FileBase) MustGetNumberOfLinesWithPrefix ¶
func (*FileBase) MustGetNumberOfNonEmptyLines ¶
func (*FileBase) MustGetParentDirectoryPath ¶
func (*FileBase) MustGetParentFileForBaseClass ¶
func (*FileBase) MustGetPathAndHostDescription ¶
func (*FileBase) MustGetSha256Sum ¶
func (*FileBase) MustGetTextBlocks ¶
func (*FileBase) MustGetValueAsInt ¶
func (*FileBase) MustGetValueAsString ¶
func (*FileBase) MustIsContentEqualByComparingSha256Sum ¶
func (*FileBase) MustIsEmptyFile ¶
func (*FileBase) MustIsLocalFile ¶
func (*FileBase) MustIsMatchingSha256Sum ¶
func (*FileBase) MustIsPgpEncrypted ¶
func (*FileBase) MustIsYYYYmmdd_HHMMSSPrefix ¶
func (*FileBase) MustPrintContentOnStdout ¶
func (f *FileBase) MustPrintContentOnStdout()
func (*FileBase) MustReadAsBool ¶
func (*FileBase) MustReadAsFloat64 ¶
func (*FileBase) MustReadAsInt ¶
func (*FileBase) MustReadAsInt64 ¶
func (*FileBase) MustReadAsLines ¶
func (*FileBase) MustReadAsLinesWithoutComments ¶
func (*FileBase) MustReadAsString ¶
func (*FileBase) MustReadAsTimeTime ¶
func (*FileBase) MustReadFirstLine ¶
func (*FileBase) MustReadFirstLineAndTrimSpace ¶
func (*FileBase) MustReadLastCharAsString ¶
func (*FileBase) MustRemoveLinesWithPrefix ¶
func (*FileBase) MustReplaceLineAfterLine ¶
func (f *FileBase) MustReplaceLineAfterLine(lineToFind string, replaceLineAfterWith string, verbose bool) (changeSummary *changesummary.ChangeSummary)
func (*FileBase) MustSetParentFileForBaseClass ¶
func (*FileBase) MustSortBlocksInFile ¶
func (*FileBase) MustTrimSpacesAtBeginningOfFile ¶
func (*FileBase) MustWriteInt64 ¶
func (*FileBase) MustWriteLines ¶
func (*FileBase) MustWriteString ¶
func (*FileBase) MustWriteTextBlocks ¶
func (*FileBase) PrintContentOnStdout ¶
func (*FileBase) ReadAsBool ¶
func (*FileBase) ReadAsFloat64 ¶
func (*FileBase) ReadAsInt64 ¶
func (*FileBase) ReadAsLines ¶
func (*FileBase) ReadAsLinesWithoutComments ¶
func (*FileBase) ReadAsString ¶
func (*FileBase) ReadFirstLine ¶
func (*FileBase) ReadFirstLineAndTrimSpace ¶
func (*FileBase) ReadLastCharAsString ¶
func (*FileBase) RemoveLinesWithPrefix ¶
func (*FileBase) ReplaceLineAfterLine ¶
func (f *FileBase) ReplaceLineAfterLine(lineToFind string, replaceLineAfterWith string, verbose bool) (changeSummary *changesummary.ChangeSummary, err error)
func (*FileBase) SetParentFileForBaseClass ¶
func (*FileBase) SortBlocksInFile ¶
func (*FileBase) TrimSpacesAtBeginningOfFile ¶
func (*FileBase) WriteInt64 ¶
func (*FileBase) WriteLines ¶
func (*FileBase) WriteString ¶
type FileInfo ¶
func NewFileInfo ¶
func NewFileInfo() (f *FileInfo)
func (*FileInfo) GetPathAndSizeBytes ¶
func (*FileInfo) GetSizeBytes ¶
func (*FileInfo) MustGetPath ¶
func (*FileInfo) MustGetPathAndSizeBytes ¶
func (*FileInfo) MustGetSizeBytes ¶
func (*FileInfo) MustSetPath ¶
func (*FileInfo) MustSetSizeBytes ¶
func (*FileInfo) SetSizeBytes ¶
type FilesService ¶
type FilesService struct { }
func Files ¶
func Files() (f *FilesService)
func NewFilesService ¶
func NewFilesService() (f *FilesService)
func (*FilesService) MustReadAsString ¶
func (f *FilesService) MustReadAsString(path string) (content string)
func (*FilesService) MustWriteStringToFile ¶
func (f *FilesService) MustWriteStringToFile(path string, content string, verbose bool)
func (*FilesService) ReadAsString ¶
func (f *FilesService) ReadAsString(path string) (content string, err error)
func (*FilesService) WriteStringToFile ¶
func (f *FilesService) WriteStringToFile(path string, content string, verbose bool) (err error)
type LocalDirectory ¶
type LocalDirectory struct { DirectoryBase // contains filtered or unexported fields }
func GetCurrentWorkingDirectory ¶
func GetCurrentWorkingDirectory() (workingDirectory *LocalDirectory, err error)
func GetLocalDirectoryByPath ¶
func GetLocalDirectoryByPath(path string) (l *LocalDirectory, err error)
func MustGetCurrentWorkingDirectory ¶
func MustGetCurrentWorkingDirectory() (workingDirectory *LocalDirectory)
func MustGetLocalDirectoryByPath ¶
func MustGetLocalDirectoryByPath(path string) (l *LocalDirectory)
func NewLocalDirectory ¶
func NewLocalDirectory() (l *LocalDirectory)
func (*LocalDirectory) Chmod ¶
func (l *LocalDirectory) Chmod(chmodOptions *parameteroptions.ChmodOptions) (err error)
func (*LocalDirectory) CopyContentToDirectory ¶
func (l *LocalDirectory) CopyContentToDirectory(destinationDir Directory, verbose bool) (err error)
func (*LocalDirectory) CopyContentToLocalDirectory ¶
func (l *LocalDirectory) CopyContentToLocalDirectory(destDirectory *LocalDirectory, verbose bool) (err error)
func (*LocalDirectory) Create ¶
func (l *LocalDirectory) Create(verbose bool) (err error)
func (*LocalDirectory) CreateFileInDirectory ¶
func (l *LocalDirectory) CreateFileInDirectory(verbose bool, path ...string) (createdFile File, err error)
func (*LocalDirectory) CreateFilesInDirectory ¶
func (l *LocalDirectory) CreateFilesInDirectory(filesToCreate []string, verbose bool) (createdFiles []File, err error)
func (*LocalDirectory) CreateSubDirectory ¶
func (l *LocalDirectory) CreateSubDirectory(subDirName string, verbose bool) (createdSubDir Directory, err error)
func (*LocalDirectory) Delete ¶
func (l *LocalDirectory) Delete(verbose bool) (err error)
func (*LocalDirectory) Exists ¶
func (l *LocalDirectory) Exists(verbose bool) (exists bool, err error)
func (*LocalDirectory) GetBaseName ¶
func (l *LocalDirectory) GetBaseName() (baseName string, err error)
func (*LocalDirectory) GetDirName ¶
func (l *LocalDirectory) GetDirName() (parentPath string, err error)
func (*LocalDirectory) GetFileInDirectory ¶
func (l *LocalDirectory) GetFileInDirectory(path ...string) (file File, err error)
func (*LocalDirectory) GetFileInDirectoryAsLocalFile ¶
func (l *LocalDirectory) GetFileInDirectoryAsLocalFile(filePath ...string) (localFile *LocalFile, err error)
func (*LocalDirectory) GetHostDescription ¶
func (l *LocalDirectory) GetHostDescription() (hostDescription string, err error)
func (*LocalDirectory) GetLocalPath ¶
func (l *LocalDirectory) GetLocalPath() (localPath string, err error)
func (*LocalDirectory) GetParentDirectory ¶
func (l *LocalDirectory) GetParentDirectory() (parentDirectory Directory, err error)
func (*LocalDirectory) GetPath ¶
func (l *LocalDirectory) GetPath() (dirPath string, err error)
func (*LocalDirectory) GetSubDirectory ¶
func (l *LocalDirectory) GetSubDirectory(path ...string) (subDirectory Directory, err error)
func (*LocalDirectory) GetSubDirectoryAndLocalPath ¶
func (l *LocalDirectory) GetSubDirectoryAndLocalPath(path ...string) (subDirectory Directory, subDirectoryPath string, err error)
func (*LocalDirectory) IsEmptyDirectory ¶
func (l *LocalDirectory) IsEmptyDirectory(verbose bool) (isEmpty bool, err error)
func (*LocalDirectory) IsLocalDirectory ¶
func (l *LocalDirectory) IsLocalDirectory() (isLocalDirectory bool, err error)
func (*LocalDirectory) ListFilePaths ¶
func (l *LocalDirectory) ListFilePaths(listOptions *parameteroptions.ListFileOptions) (filePathList []string, err error)
func (*LocalDirectory) ListFiles ¶
func (l *LocalDirectory) ListFiles(options *parameteroptions.ListFileOptions) (files []File, err error)
func (*LocalDirectory) ListSubDirectories ¶
func (l *LocalDirectory) ListSubDirectories(listDirectoryOptions *parameteroptions.ListDirectoryOptions) (subDirectories []Directory, err error)
func (*LocalDirectory) ListSubDirectoriesAsAbsolutePaths ¶
func (l *LocalDirectory) ListSubDirectoriesAsAbsolutePaths(listDirectoryOptions *parameteroptions.ListDirectoryOptions) (subDirectoryPaths []string, err error)
func (*LocalDirectory) MustChmod ¶
func (l *LocalDirectory) MustChmod(chmodOptions *parameteroptions.ChmodOptions)
func (*LocalDirectory) MustCopyContentToDirectory ¶
func (l *LocalDirectory) MustCopyContentToDirectory(destinationDir Directory, verbose bool)
func (*LocalDirectory) MustCopyContentToLocalDirectory ¶
func (l *LocalDirectory) MustCopyContentToLocalDirectory(destDirectory *LocalDirectory, verbose bool)
func (*LocalDirectory) MustCreate ¶
func (l *LocalDirectory) MustCreate(verbose bool)
func (*LocalDirectory) MustCreateFileInDirectory ¶
func (l *LocalDirectory) MustCreateFileInDirectory(verbose bool, path ...string) (createdFile File)
func (*LocalDirectory) MustCreateFilesInDirectory ¶
func (l *LocalDirectory) MustCreateFilesInDirectory(filesToCreate []string, verbose bool) (createdFiles []File)
func (*LocalDirectory) MustCreateSubDirectory ¶
func (l *LocalDirectory) MustCreateSubDirectory(subDirName string, verbose bool) (createdSubDir Directory)
func (*LocalDirectory) MustDelete ¶
func (l *LocalDirectory) MustDelete(verbose bool)
func (*LocalDirectory) MustExists ¶
func (l *LocalDirectory) MustExists(verbose bool) (exists bool)
func (*LocalDirectory) MustGetBaseName ¶
func (l *LocalDirectory) MustGetBaseName() (baseName string)
func (*LocalDirectory) MustGetDirName ¶
func (l *LocalDirectory) MustGetDirName() (dirName string)
func (*LocalDirectory) MustGetFileInDirectory ¶
func (l *LocalDirectory) MustGetFileInDirectory(path ...string) (file File)
func (*LocalDirectory) MustGetFileInDirectoryAsLocalFile ¶
func (l *LocalDirectory) MustGetFileInDirectoryAsLocalFile(filePath ...string) (localFile *LocalFile)
func (*LocalDirectory) MustGetHostDescription ¶
func (l *LocalDirectory) MustGetHostDescription() (hostDescription string)
func (*LocalDirectory) MustGetLocalPath ¶
func (l *LocalDirectory) MustGetLocalPath() (localPath string)
func (*LocalDirectory) MustGetParentDirectory ¶
func (l *LocalDirectory) MustGetParentDirectory() (parentDirectory Directory)
func (*LocalDirectory) MustGetPath ¶
func (l *LocalDirectory) MustGetPath() (dirPath string)
func (*LocalDirectory) MustGetSubDirectory ¶
func (l *LocalDirectory) MustGetSubDirectory(path ...string) (subDirectory Directory)
func (*LocalDirectory) MustGetSubDirectoryAndLocalPath ¶
func (l *LocalDirectory) MustGetSubDirectoryAndLocalPath(path ...string) (subDirectory Directory, subDirectoryPath string)
func (*LocalDirectory) MustIsEmptyDirectory ¶
func (l *LocalDirectory) MustIsEmptyDirectory(verbose bool) (isEmpty bool)
func (*LocalDirectory) MustIsLocalDirectory ¶
func (l *LocalDirectory) MustIsLocalDirectory() (isLocalDirectory bool)
func (*LocalDirectory) MustListFilePaths ¶
func (l *LocalDirectory) MustListFilePaths(listOptions *parameteroptions.ListFileOptions) (filePathList []string)
func (*LocalDirectory) MustListFilePathsns ¶
func (l *LocalDirectory) MustListFilePathsns(listOptions *parameteroptions.ListFileOptions) (filePathList []string)
func (*LocalDirectory) MustListFiles ¶
func (l *LocalDirectory) MustListFiles(options *parameteroptions.ListFileOptions) (files []File)
func (*LocalDirectory) MustListSubDirectories ¶
func (l *LocalDirectory) MustListSubDirectories(listDirectoryOptions *parameteroptions.ListDirectoryOptions) (subDirectories []Directory)
func (*LocalDirectory) MustListSubDirectoriesAsAbsolutePaths ¶
func (l *LocalDirectory) MustListSubDirectoriesAsAbsolutePaths(listDirectoryOptions *parameteroptions.ListDirectoryOptions) (subDirectoryPaths []string)
func (*LocalDirectory) MustSetLocalPath ¶
func (l *LocalDirectory) MustSetLocalPath(localPath string)
func (*LocalDirectory) MustSubDirectoryExists ¶
func (l *LocalDirectory) MustSubDirectoryExists(subDirName string, verbose bool) (subDirExists bool)
func (*LocalDirectory) SetLocalPath ¶
func (l *LocalDirectory) SetLocalPath(localPath string) (err error)
func (*LocalDirectory) SubDirectoryExists ¶
func (l *LocalDirectory) SubDirectoryExists(subDirName string, verbose bool) (subDirExists bool, err error)
type LocalFile ¶
type LocalFile struct { FileBase // contains filtered or unexported fields }
A LocalFile represents a locally available file.
func GetLocalFileByFile ¶
func GetLocalFileByPath ¶
func MustGetLocalFileByFile ¶
func MustGetLocalFileByPath ¶
func MustNewLocalFileByPath ¶
func NewLocalFile ¶
func NewLocalFile() (l *LocalFile)
func NewLocalFileByPath ¶
func (*LocalFile) AppendBytes ¶
func (*LocalFile) AppendString ¶
func (*LocalFile) Chmod ¶
func (l *LocalFile) Chmod(chmodOptions *parameteroptions.ChmodOptions) (err error)
func (*LocalFile) Chown ¶
func (l *LocalFile) Chown(options *parameteroptions.ChownOptions) (err error)
func (*LocalFile) CopyToFile ¶
func (*LocalFile) Delete ¶
Delete a file if it exists. If the file is already absent this function does nothing.
func (*LocalFile) GetBaseName ¶
func (*LocalFile) GetDeepCopy ¶
func (*LocalFile) GetHostDescription ¶
func (*LocalFile) GetLocalPath ¶
func (*LocalFile) GetLocalPathOrEmptyStringIfUnset ¶
func (*LocalFile) GetParentDirectory ¶
func (*LocalFile) GetParentFileForBaseClassAsLocalFile ¶
func (*LocalFile) GetSizeBytes ¶
func (*LocalFile) GetUriAsString ¶
func (*LocalFile) MoveToPath ¶
func (*LocalFile) MustAppendBytes ¶
func (*LocalFile) MustAppendString ¶
func (*LocalFile) MustChmod ¶
func (l *LocalFile) MustChmod(chmodOptions *parameteroptions.ChmodOptions)
func (*LocalFile) MustChown ¶
func (l *LocalFile) MustChown(options *parameteroptions.ChownOptions)