utils

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateFileHash

func CalculateFileHash(filePath string) (string, error)

CalculateFileHash calculates SHA256 hash of a file

func CreateZipArchive

func CreateZipArchive(sourceDir, outputDir string) (string, error)

CreateZipArchive creates a ZIP archive of the specified directory

func EnsureDir

func EnsureDir(dirPath string) error

EnsureDir ensures that a directory exists, creating it if necessary

func FileExists

func FileExists(filePath string) bool

FileExists checks if a file exists

func GetFileSize

func GetFileSize(filePath string) (int64, error)

GetFileSize returns the size of a file in bytes

func IsDirEmpty

func IsDirEmpty(dirname string) bool

IsDirEmpty checks if a directory is empty

func IsTextFile

func IsTextFile(filePath string) bool

IsTextFile determines if a file is likely a text file based on its extension

func NormalizePath

func NormalizePath(path string) string

NormalizePath normalizes a file path for cross-platform compatibility

func SanitizeFileName

func SanitizeFileName(fileName string) string

SanitizeFileName removes or replaces invalid characters from a filename

Types

This section is empty.

Jump to

Keyboard shortcuts

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