utils

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package utils provides helper functions for working with files, directories and strings that are shared across the proxsave codebase.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsPath

func AbsPath(path string) (string, error)

AbsPath restituisce il path assoluto di un file

func ComputeSHA256

func ComputeSHA256(filePath string) (string, error)

ComputeSHA256 calcola il checksum SHA256 di un file

func DirExists

func DirExists(path string) bool

DirExists verifica se una directory esiste

func EnsureDir

func EnsureDir(path string) error

EnsureDir crea una directory se non esiste

func FileExists

func FileExists(path string) bool

FileExists verifica se un file esiste

func FormatBytes

func FormatBytes(bytes int64) string

FormatBytes converte bytes in formato human-readable (KB, MB, GB, ecc.)

func GenerateRandomString

func GenerateRandomString(length int) string

GenerateRandomString generates a random string of the specified length

func GetFileSize

func GetFileSize(filePath string) (int64, error)

GetFileSize restituisce la dimensione di un file in bytes

func IsAbsPath

func IsAbsPath(path string) bool

IsAbsPath verifica se un path è assoluto

func IsComment

func IsComment(line string) bool

IsComment verifica se una linea è un commento (inizia con #)

func ParseBool

func ParseBool(s string) bool

ParseBool converte una stringa in booleano (supporta vari formati)

func SplitKeyValue

func SplitKeyValue(line string) (string, string, bool)

SplitKeyValue divide una stringa "key=value" in key e value Supporta anche commenti inline: KEY="value" # comment

func TrimQuotes

func TrimQuotes(s string) string

TrimQuotes rimuove le virgolette da una stringa

Types

This section is empty.

Jump to

Keyboard shortcuts

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