Documentation ¶
Index ¶
- type ChecksumMethod
- type DefaultFileIo
- func (f DefaultFileIo) Checksum(path string, method ChecksumMethod) (string, error)
- func (f DefaultFileIo) CopyDir(source, destination string) error
- func (f DefaultFileIo) CopyFile(source, destination string) error
- func (f DefaultFileIo) CreateDir(folderPath string, mode os.FileMode) error
- func (f DefaultFileIo) DeleteDir(path string) error
- func (f DefaultFileIo) DeleteFile(path string) error
- func (f DefaultFileIo) DirExists(folderPath string) bool
- func (f DefaultFileIo) FileExists(path string) bool
- func (f DefaultFileIo) GetExecutionPath() string
- func (f DefaultFileIo) GetOperatingSystem() OperatingSystem
- func (f DefaultFileIo) GetOsPathSeparator() string
- func (f DefaultFileIo) JoinPath(parts ...string) string
- func (f DefaultFileIo) ReadBufferedFile(path string, from, to int) ([]byte, error)
- func (f DefaultFileIo) ReadDir(path string) ([]fs.DirEntry, error)
- func (f DefaultFileIo) ReadFile(path string) ([]byte, error)
- func (f DefaultFileIo) ToOsPath(path string) string
- func (f DefaultFileIo) WriteBufferedFile(path string, data []byte, bufferSize int, mode os.FileMode) error
- func (f DefaultFileIo) WriteFile(path string, data []byte, mode os.FileMode) error
- type FileIo
- type OperatingSystem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChecksumMethod ¶
type ChecksumMethod int
const ( ChecksumMD5 ChecksumMethod = iota ChecksumSHA1 ChecksumSHA256 )
type DefaultFileIo ¶
type DefaultFileIo struct{}
func Default ¶
func Default() DefaultFileIo
func (DefaultFileIo) Checksum ¶
func (f DefaultFileIo) Checksum(path string, method ChecksumMethod) (string, error)
func (DefaultFileIo) CopyDir ¶
func (f DefaultFileIo) CopyDir(source, destination string) error
func (DefaultFileIo) CopyFile ¶
func (f DefaultFileIo) CopyFile(source, destination string) error
func (DefaultFileIo) CreateDir ¶
func (f DefaultFileIo) CreateDir(folderPath string, mode os.FileMode) error
func (DefaultFileIo) DeleteDir ¶
func (f DefaultFileIo) DeleteDir(path string) error
func (DefaultFileIo) DeleteFile ¶
func (f DefaultFileIo) DeleteFile(path string) error
func (DefaultFileIo) DirExists ¶
func (f DefaultFileIo) DirExists(folderPath string) bool
func (DefaultFileIo) FileExists ¶
func (f DefaultFileIo) FileExists(path string) bool
func (DefaultFileIo) GetExecutionPath ¶
func (f DefaultFileIo) GetExecutionPath() string
func (DefaultFileIo) GetOperatingSystem ¶
func (f DefaultFileIo) GetOperatingSystem() OperatingSystem
func (DefaultFileIo) GetOsPathSeparator ¶
func (f DefaultFileIo) GetOsPathSeparator() string
func (DefaultFileIo) JoinPath ¶
func (f DefaultFileIo) JoinPath(parts ...string) string
func (DefaultFileIo) ReadBufferedFile ¶
func (f DefaultFileIo) ReadBufferedFile(path string, from, to int) ([]byte, error)
func (DefaultFileIo) ToOsPath ¶
func (f DefaultFileIo) ToOsPath(path string) string
func (DefaultFileIo) WriteBufferedFile ¶
type FileIo ¶
type FileIo interface { GetOperatingSystem() OperatingSystem FileExists(path string) bool DirExists(folderPath string) bool CreateDir(folderPath string, mode fs.FileMode) error GetExecutionPath() string ToOsPath(path string) string GetOsPathSeparator() string ReadFile(path string) ([]byte, error) ReadBufferedFile(path string, from, to int) ([]byte, error) WriteFile(path string, data []byte, mode os.FileMode) error WriteBufferedFile(path string, data []byte, bufferSize int, mode os.FileMode) error ReadDir(path string) ([]fs.DirEntry, error) JoinPath(parts ...string) string CopyFile(source, destination string) error DeleteFile(path string) error CopyDir(source, destination string) error DeleteDir(path string) error Checksum(path string, method ChecksumMethod) (string, error) }
type OperatingSystem ¶
type OperatingSystem int
OperatingSystem enum
const ( UnknownOs OperatingSystem = iota WindowsOs LinuxOs MacOs )
Defines the operating system Enum
Source Files ¶
Click to show internal directories.
Click to hide internal directories.