Documentation ¶
Index ¶
- Constants
- func AppendFile(filePath string, content []byte) *errorwrapper.Wrapper
- func AppendFileUsingLock(filePath string, content []byte) *errorwrapper.Wrapper
- func AppendStringFile(filePath string, content string) *errorwrapper.Wrapper
- func AppendStringFileUsingLock(filePath string, content string) *errorwrapper.Wrapper
- func CheckSumFileBytes(hashType hashas.Variant, location string) *errbyte.Results
- func CheckSumFileBytesUsingLock(hashType hashas.Variant, location string) *errbyte.Results
- func CheckSumFileString(hashType hashas.Variant, location string) *errstr.Result
- func CheckSumFileStringUsingLock(hashType hashas.Variant, location string) *errstr.Result
- func CopyFile(srcPath, dstPath string) *errorwrapper.Wrapper
- func CopyFileContents(srcPath, dstPath string) (errWp *errorwrapper.Wrapper)
- func CopySymLink(src, dst string) error
- func CreateDirectoryAllDefault(location string) *errorwrapper.Wrapper
- func CreateDirectoryAllUptoParent(location string) *errorwrapper.Wrapper
- func GetFileName(location string) string
- func IsDirectory(location string) bool
- func IsExistButDirectory(location string) bool
- func IsNotPathExists(location string) bool
- func IsNotPathExistsUsing(fileInfo os.FileInfo, err error) bool
- func IsPathExists(location string) bool
- func IsPathExistsUsing(fileInfo os.FileInfo, err error) bool
- func IsPathExistsUsingLock(location string) bool
- func JsonReadUnmarshal(filePath string, unmarshallObjectRef interface{}) *errorwrapper.Wrapper
- func JsonReadUnmarshalLock(filePath string, unmarshallObjectRef interface{}) *errorwrapper.Wrapper
- func JsonWriteMarshal(isSkipOnNilObject bool, filePath string, fileMod os.FileMode, ...) *errorwrapper.Wrapper
- func JsonWriteMarshalUsingLock(isSkipOnNilObject bool, filePath string, fileMod os.FileMode, ...) *errorwrapper.Wrapper
- func LinuxTouchFile(fullPath string) *errorwrapper.Wrapper
- func LinuxTouchFileUsingLock(fullPath string) *errorwrapper.Wrapper
- func LinuxTouchLocationFile(parentPath, fileName string) *errorwrapper.Wrapper
- func MoveFile(srcPath, dstPath string) *errorwrapper.Wrapper
- func ParentDir(location string) string
- func Read(location string, filename string) *errbyte.Results
- func ReadErrorJsonResult(filePath string) *errjson.Result
- func ReadErrorJsonResultUnmarshal(filePath string, unmarshalObject interface{}) *errorwrapper.Wrapper
- func ReadErrorJsonResultUnmarshalUsingLock(filePath string, unmarshalObject interface{}) *errorwrapper.Wrapper
- func ReadErrorJsonResultUsingLock(filePath string) *errjson.Result
- func ReadFile(filePath string) *errbyte.Results
- func ReadFileLinesUsingLock(filePath string) *errstr.Results
- func ReadFileNonWhitespaceLinesUsingLock(filePath string) *errstr.Results
- func ReadFileString(filePath string) *errstr.Result
- func ReadFileStringIfExistUsingLock(filePath string) *errstr.Result
- func ReadFileStringUsingLock(filePath string) *errstr.Result
- func ReadFileUsingLock(filePath string) *errbyte.Results
- func ReadJsonParseSelfInjector(filePath string, jsonParseSelfInjector corejson.JsonParseSelfInjector) *errorwrapper.Wrapper
- func ReadJsonParseSelfInjectorUsingLock(filePath string, jsonParseSelfInjector corejson.JsonParseSelfInjector) *errorwrapper.Wrapper
- func ReadUsingLock(location string, filename string) *errbyte.Results
- func Remove(location string) *errorwrapper.Wrapper
- func Rename(srcPath, dstPath string) *errorwrapper.Wrapper
- func SafeRemove(location string) *errorwrapper.Wrapper
- func Write(location string, filename string, content []byte) *errorwrapper.Wrapper
- func WriteAnyLock(filePath string, content interface{}) *errorwrapper.Wrapper
- func WriteErrorJsonResult(isSkipErrorOnNilOrEmpty bool, errJsonResult *errjson.Result, location string) *errorwrapper.Wrapper
- func WriteErrorJsonResultUsingLock(isSkipErrorOnNilOrEmpty bool, errJsonResult *errjson.Result, location string) *errorwrapper.Wrapper
- func WriteFile(filePath string, content []byte) *errorwrapper.Wrapper
- func WriteFileLock(filePath string, content []byte) *errorwrapper.Wrapper
- func WriteFileUsingFileMode(filePath string, content []byte, mode os.FileMode, ...) *errorwrapper.Wrapper
- func WriteJsonResult(isSkipErrorOnNilOrEmpty bool, jsonResult *corejson.Result, location string) *errorwrapper.Wrapper
- func WriteJsonResultUsingLock(isSkipErrorOnNilOrEmpty bool, jsonResult *corejson.Result, location string) *errorwrapper.Wrapper
- func WriteStringLinesToFile(filePath string, contentLines []string) *errorwrapper.Wrapper
- func WriteStringLinesToFileUsingLock(filePath string, contentLines []string) *errorwrapper.Wrapper
- func WriteStringToFile(filePath string, content string) *errorwrapper.Wrapper
- func WriteStringToFileUsingLock(filePath string, content string) *errorwrapper.Wrapper
- func WriteStringToFileUsingLockFileMode(filePath string, content string, fileMode os.FileMode, ...) *errorwrapper.Wrapper
- type OsFile
- func DirFileCreate(existingFileErrorWrapper *errorwrapper.Wrapper, ...) *OsFile
- func GetOsFile(existingErrorWrapper *errorwrapper.Wrapper, filePath string, osFlag int, ...) *OsFile
- func GetOsFileAppendOrWrite(existingErrorWrapper *errorwrapper.Wrapper, filePath string, ...) *OsFile
- func GetOsFileAppendOrWriteOrCreate(existingErrorWrapper *errorwrapper.Wrapper, filePath string, ...) *OsFile
- func GetOsFileReadOnly(existingErrorWrapper *errorwrapper.Wrapper, filePath string, ...) *OsFile
- func GetOsFileWriteOrCreate(existingErrorWrapper *errorwrapper.Wrapper, filePath string, ...) *OsFile
- func TempFileCreate(existingFileErrorWrapper *errorwrapper.Wrapper, relativeFilePath string, ...) *OsFile
- func TempFileCreateDefaultChmod(existingFileErrorWrapper *errorwrapper.Wrapper, relativeFilePath string) *OsFile
- func (it *OsFile) ApplyChmod(mode os.FileMode) *errorwrapper.Wrapper
- func (it *OsFile) AttachDeferCloseOnRequire() *errorwrapper.Wrapper
- func (it *OsFile) BothExtension() (dotExt, ext string)
- func (it *OsFile) ChmodWithError() *pathchmod.ChmodWithError
- func (it *OsFile) ClearFileContents() *errorwrapper.Wrapper
- func (it *OsFile) Close() *errorwrapper.Wrapper
- func (it *OsFile) FileInfo() (os.FileInfo, *errorwrapper.Wrapper)
- func (it *OsFile) FileName() string
- func (it *OsFile) HasError() bool
- func (it *OsFile) HasFile() bool
- func (it *OsFile) IsDeferCloseRequired() bool
- func (it *OsFile) IsEmptyError() bool
- func (it *OsFile) IsEmptyFile() bool
- func (it *OsFile) IsSafeFile() bool
- func (it *OsFile) ParentDir() string
- func (it *OsFile) RwxWrapper() *pathchmod.RwxWrapperWithError
- func (it *OsFile) WriteBytes(writingBytes []byte) (hasWrittenSuccessfully bool, errWp *errorwrapper.Wrapper)
- func (it *OsFile) WriteString(writingString string) (hasWrittenSuccessfully bool, errWp *errorwrapper.Wrapper)
Constants ¶
View Source
const ( FlagAppend = os.O_APPEND FlagWrite = os.O_WRONLY FlagCreate = os.O_CREATE FlagReadOnly = os.O_RDONLY FlagAppendOrWrite = FlagAppend | FlagWrite FlagWriteOrCreate = FlagWrite | FlagCreate FlagWriteOrCreateOrAppend = FlagWrite | FlagCreate | FlagAppend )
Variables ¶
This section is empty.
Functions ¶
func AppendFile ¶ added in v0.1.7
func AppendFile( filePath string, content []byte, ) *errorwrapper.Wrapper
func AppendFileUsingLock ¶ added in v0.1.7
func AppendFileUsingLock( filePath string, content []byte, ) *errorwrapper.Wrapper
func AppendStringFile ¶ added in v0.1.7
func AppendStringFile( filePath string, content string, ) *errorwrapper.Wrapper
func AppendStringFileUsingLock ¶ added in v0.1.7
func AppendStringFileUsingLock( filePath string, content string, ) *errorwrapper.Wrapper
func CheckSumFileBytes ¶ added in v0.2.2
func CheckSumFileBytesUsingLock ¶ added in v0.2.2
func CheckSumFileString ¶ added in v0.2.2
func CheckSumFileStringUsingLock ¶ added in v0.2.2
func CopyFile ¶
func CopyFile(srcPath, dstPath string) *errorwrapper.Wrapper
CopyFile Future ref: https://stackoverflow.com/a/21067803
func CopyFileContents ¶ added in v0.2.2
func CopyFileContents(srcPath, dstPath string) (errWp *errorwrapper.Wrapper)
func CopySymLink ¶ added in v0.2.8
CopySymLink copies a symbolic link from src to dst.
func CreateDirectoryAllDefault ¶
func CreateDirectoryAllDefault(location string) *errorwrapper.Wrapper
func CreateDirectoryAllUptoParent ¶
func CreateDirectoryAllUptoParent(location string) *errorwrapper.Wrapper
func GetFileName ¶
func IsDirectory ¶
func IsExistButDirectory ¶ added in v0.1.7
func IsNotPathExists ¶ added in v0.2.2
func IsNotPathExistsUsing ¶ added in v0.2.2
func IsPathExists ¶
func IsPathExistsUsing ¶ added in v0.2.2
func IsPathExistsUsingLock ¶ added in v0.2.0
func JsonReadUnmarshal ¶ added in v0.2.2
func JsonReadUnmarshal( filePath string, unmarshallObjectRef interface{}, ) *errorwrapper.Wrapper
func JsonReadUnmarshalLock ¶ added in v0.2.2
func JsonReadUnmarshalLock( filePath string, unmarshallObjectRef interface{}, ) *errorwrapper.Wrapper
func JsonWriteMarshal ¶ added in v0.2.2
func JsonWriteMarshalUsingLock ¶ added in v0.2.2
func LinuxTouchFile ¶ added in v0.2.1
func LinuxTouchFile(fullPath string) *errorwrapper.Wrapper
func LinuxTouchFileUsingLock ¶ added in v0.2.2
func LinuxTouchFileUsingLock(fullPath string) *errorwrapper.Wrapper
func LinuxTouchLocationFile ¶ added in v0.2.1
func LinuxTouchLocationFile(parentPath, fileName string) *errorwrapper.Wrapper
func MoveFile ¶ added in v0.2.2
func MoveFile(srcPath, dstPath string) *errorwrapper.Wrapper
MoveFile move file path from source to destination
func ReadErrorJsonResult ¶ added in v0.2.4
func ReadErrorJsonResultUnmarshal ¶ added in v0.2.4
func ReadErrorJsonResultUnmarshal( filePath string, unmarshalObject interface{}, ) *errorwrapper.Wrapper
func ReadErrorJsonResultUnmarshalUsingLock ¶ added in v0.2.4
func ReadErrorJsonResultUnmarshalUsingLock( filePath string, unmarshalObject interface{}, ) *errorwrapper.Wrapper
func ReadErrorJsonResultUsingLock ¶ added in v0.2.4
func ReadFileLinesUsingLock ¶ added in v0.2.0
func ReadFileNonWhitespaceLinesUsingLock ¶ added in v0.2.0
func ReadFileString ¶ added in v0.2.0
func ReadFileStringIfExistUsingLock ¶ added in v0.2.0
func ReadFileStringUsingLock ¶ added in v0.2.0
func ReadFileUsingLock ¶ added in v0.2.0
func ReadJsonParseSelfInjector ¶ added in v0.2.4
func ReadJsonParseSelfInjector( filePath string, jsonParseSelfInjector corejson.JsonParseSelfInjector, ) *errorwrapper.Wrapper
func ReadJsonParseSelfInjectorUsingLock ¶ added in v0.2.4
func ReadJsonParseSelfInjectorUsingLock( filePath string, jsonParseSelfInjector corejson.JsonParseSelfInjector, ) *errorwrapper.Wrapper
func ReadUsingLock ¶ added in v0.2.0
func Remove ¶
func Remove(location string) *errorwrapper.Wrapper
Remove Reference : https://t.ly/xnAe
func Rename ¶
func Rename(srcPath, dstPath string) *errorwrapper.Wrapper
func SafeRemove ¶
func SafeRemove(location string) *errorwrapper.Wrapper
SafeRemove Reference : https://t.ly/xnAe
func WriteAnyLock ¶ added in v0.2.0
func WriteAnyLock( filePath string, content interface{}, ) *errorwrapper.Wrapper
func WriteErrorJsonResult ¶ added in v0.2.4
func WriteErrorJsonResultUsingLock ¶ added in v0.2.4
func WriteFileLock ¶ added in v0.1.6
func WriteFileLock( filePath string, content []byte, ) *errorwrapper.Wrapper
func WriteFileUsingFileMode ¶ added in v0.2.2
func WriteJsonResult ¶ added in v0.2.4
func WriteJsonResultUsingLock ¶ added in v0.2.4
func WriteStringLinesToFile ¶
func WriteStringLinesToFile( filePath string, contentLines []string, ) *errorwrapper.Wrapper
func WriteStringLinesToFileUsingLock ¶ added in v0.1.6
func WriteStringLinesToFileUsingLock( filePath string, contentLines []string, ) *errorwrapper.Wrapper
func WriteStringToFile ¶
func WriteStringToFile( filePath string, content string, ) *errorwrapper.Wrapper
func WriteStringToFileUsingLock ¶ added in v0.1.6
func WriteStringToFileUsingLock( filePath string, content string, ) *errorwrapper.Wrapper
func WriteStringToFileUsingLockFileMode ¶ added in v0.2.2
Types ¶
type OsFile ¶ added in v0.2.2
type OsFile struct { Location string OsFile *os.File ErrorWrapper *errorwrapper.Wrapper DeferClosingFunc func() *errorwrapper.Wrapper // must be called upon checking IsDeferCloseRequired // contains filtered or unexported fields }
OsFile defer function must be called to close the file.
func DirFileCreate ¶ added in v0.2.2
func GetOsFile ¶ added in v0.2.2
func GetOsFile( existingErrorWrapper *errorwrapper.Wrapper, filePath string, osFlag int, fileMode os.FileMode, ) *OsFile
GetOsFile defer function must be called to close the file.
func GetOsFileAppendOrWrite ¶ added in v0.2.2
func GetOsFileAppendOrWrite( existingErrorWrapper *errorwrapper.Wrapper, filePath string, fileMode os.FileMode, ) *OsFile
GetOsFileAppendOrWrite defer function must be called to close the file.
func GetOsFileAppendOrWriteOrCreate ¶ added in v0.2.2
func GetOsFileAppendOrWriteOrCreate( existingErrorWrapper *errorwrapper.Wrapper, filePath string, fileMode os.FileMode, ) *OsFile
GetOsFileAppendOrWriteOrCreate defer function must be called to close the file.
func GetOsFileReadOnly ¶ added in v0.2.2
func GetOsFileReadOnly( existingErrorWrapper *errorwrapper.Wrapper, filePath string, fileMode os.FileMode, ) *OsFile
GetOsFileReadOnly defer function must be called to close the file.
func GetOsFileWriteOrCreate ¶ added in v0.2.2
func GetOsFileWriteOrCreate( existingErrorWrapper *errorwrapper.Wrapper, filePath string, fileMode os.FileMode, ) *OsFile
GetOsFileWriteOrCreate defer function must be called to close the file.
func TempFileCreate ¶ added in v0.2.2
func TempFileCreateDefaultChmod ¶ added in v0.2.2
func TempFileCreateDefaultChmod( existingFileErrorWrapper *errorwrapper.Wrapper, relativeFilePath string, ) *OsFile
func (*OsFile) ApplyChmod ¶ added in v0.2.2
func (it *OsFile) ApplyChmod(mode os.FileMode) *errorwrapper.Wrapper
func (*OsFile) AttachDeferCloseOnRequire ¶ added in v0.2.2
func (it *OsFile) AttachDeferCloseOnRequire() *errorwrapper.Wrapper
func (*OsFile) BothExtension ¶ added in v0.2.2
func (*OsFile) ChmodWithError ¶ added in v0.2.2
func (it *OsFile) ChmodWithError() *pathchmod.ChmodWithError
func (*OsFile) ClearFileContents ¶ added in v0.2.2
func (it *OsFile) ClearFileContents() *errorwrapper.Wrapper
func (*OsFile) Close ¶ added in v0.2.2
func (it *OsFile) Close() *errorwrapper.Wrapper
func (*OsFile) FileInfo ¶ added in v0.2.2
func (it *OsFile) FileInfo() (os.FileInfo, *errorwrapper.Wrapper)
func (*OsFile) IsDeferCloseRequired ¶ added in v0.2.2
func (*OsFile) IsEmptyError ¶ added in v0.2.2
func (*OsFile) IsEmptyFile ¶ added in v0.2.2
func (*OsFile) IsSafeFile ¶ added in v0.2.2
func (*OsFile) RwxWrapper ¶ added in v0.2.2
func (it *OsFile) RwxWrapper() *pathchmod.RwxWrapperWithError
func (*OsFile) WriteBytes ¶ added in v0.2.2
func (it *OsFile) WriteBytes( writingBytes []byte, ) (hasWrittenSuccessfully bool, errWp *errorwrapper.Wrapper)
func (*OsFile) WriteString ¶ added in v0.2.2
func (it *OsFile) WriteString( writingString string, ) (hasWrittenSuccessfully bool, errWp *errorwrapper.Wrapper)
Source Files ¶
- AppendFile.go
- AppendFileUsingLock.go
- AppendStringFile.go
- AppendStringFileUsingLock.go
- CheckSumFileBytes.go
- CheckSumFileBytesUsingLock.go
- CheckSumFileString.go
- CheckSumFileStringUsingLock.go
- CopyFile.go
- CopyFileContents.go
- CopySymLink.go
- CreateDirectoryAllDefault.go
- CreateDirectoryAllUptoParent.go
- DirFileCreate.go
- GetFileName.go
- GetOsFile.go
- GetOsFileAppendOrWrite.go
- GetOsFileAppendOrWriteOrCreate.go
- GetOsFileReadOnly.go
- GetOsFileWriteOrCreate.go
- IsDirectory.go
- IsExistButDirectory.go
- IsNotPathExists.go
- IsNotPathExistsUsing.go
- IsPathExists.go
- IsPathExistsUsing.go
- IsPathExistsUsingLock.go
- JsonReadUnmarshal.go
- JsonReadUnmarshalLock.go
- JsonWriteMarshal.go
- JsonWriteMarshalUsingLock.go
- LinuxTouchFile.go
- LinuxTouchFileUsingLock.go
- LinuxTouchLocationFile.go
- MoveFile.go
- OsFile.go
- ParentDir.go
- Read.go
- ReadErrorJsonResult.go
- ReadErrorJsonResultUnmarshal.go
- ReadErrorJsonResultUnmarshalUsingLock.go
- ReadErrorJsonResultUsingLock.go
- ReadFile.go
- ReadFileLinesUsingLock.go
- ReadFileNonWhitespaceLinesUsingLock.go
- ReadFileString.go
- ReadFileStringIfExistUsingLock.go
- ReadFileStringUsingLock.go
- ReadFileUsingLock.go
- ReadJsonParseSelfInjector.go
- ReadJsonParseSelfInjectorUsingLock.go
- ReadUsingLock.go
- Remove.go
- Rename.go
- SafeRemove.go
- TempFileCreate.go
- TempFileCreateDefaultChmod.go
- Write.go
- WriteAnyLock.go
- WriteErrorJsonResult.go
- WriteErrorJsonResultUsingLock.go
- WriteFile.go
- WriteFileLock.go
- WriteFileUsingFileMode.go
- WriteJsonResult.go
- WriteJsonResultUsingLock.go
- WriteStringLinesToFile.go
- WriteStringLinesToFileUsingLock.go
- WriteStringToFile.go
- WriteStringToFileUsingLock.go
- WriteStringToFileUsingLockFileMode.go
- appendFileContent.go
- consts.go
- vars.go
- writeExistingFileContent.go
- writeExistingFileContentUsingFileMode.go
- writeNewFileContent.go
- writeNewFileContentUsingFileMode.go
Click to show internal directories.
Click to hide internal directories.