disk

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteFile

func DeleteFile(ctx context.Context, fullPath string) error

func DeleteLocalFileIfExists

func DeleteLocalFileIfExists(filename string)

func DirSize

func DirSize(path string) (int64, error)

DirSize returns the size of a directory specified by path, in bytes.

func EnsureDirectoryExists

func EnsureDirectoryExists(dir string) error

func FileExists

func FileExists(ctx context.Context, fullPath string) (bool, error)

func FileReader

func FileReader(ctx context.Context, fullPath string, offset, length int64) (io.ReadCloser, error)

func FileWriter

func FileWriter(ctx context.Context, fullPath string) (io.WriteCloser, error)

func ReadFile

func ReadFile(ctx context.Context, fullPath string) ([]byte, error)

func WriteFile

func WriteFile(ctx context.Context, fullPath string, data []byte) (int, error)

Types

type DirUsage

type DirUsage struct {
	TotalBytes uint64
	UsedBytes  uint64
	FreeBytes  uint64
	AvailBytes uint64
}

func GetDirUsage

func GetDirUsage(path string) (*DirUsage, error)

Jump to

Keyboard shortcuts

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