io

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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) ReadDir

func (f DefaultFileIo) ReadDir(path string) ([]fs.DirEntry, error)

func (DefaultFileIo) ReadFile

func (f DefaultFileIo) ReadFile(path string) ([]byte, error)

func (DefaultFileIo) ToOsPath

func (f DefaultFileIo) ToOsPath(path string) string

func (DefaultFileIo) WriteBufferedFile

func (f DefaultFileIo) WriteBufferedFile(path string, data []byte, bufferSize int, mode os.FileMode) error

func (DefaultFileIo) WriteFile

func (f DefaultFileIo) WriteFile(path string, data []byte, mode os.FileMode) error

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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