Documentation
¶
Index ¶
Constants ¶
View Source
const ( KB int64 = 1 << (10 * iota) MB GB TB )
Variables ¶
This section is empty.
Functions ¶
func FormatBytes ¶
FormatBytes converts bytes to a human-readable string (e.g., 1.5 MiB).
func GetLogger ¶
GetLogger returns the configured global logger. Should generally not be needed if slog.Default() is used throughout.
func InitLogger ¶
func InitLogger(verbose bool)
InitLogger initializes or re-initializes the global slog logger.
func NewDummyDirEntry ¶
NewDummyDirEntry creates a synthetic fs.DirEntry. Mode should be the full os.FileMode.
func ParseFileSize ¶
ParseFileSize converts a human-readable file size string (e.g., "1MB", "500KB", "1024") to bytes. Supports K, M, G, T units (case-insensitive), with an optional 'B'. Also supports plain numbers for bytes. Allows fractional inputs like "0.5MB".
Types ¶
type DummyDirEntry ¶
type DummyDirEntry struct {
// contains filtered or unexported fields
}
DummyDirEntry is a helper for creating fs.DirEntry for testing or specific scenarios
func (*DummyDirEntry) IsDir ¶
func (d *DummyDirEntry) IsDir() bool
func (*DummyDirEntry) Name ¶
func (d *DummyDirEntry) Name() string
func (*DummyDirEntry) Type ¶
func (d *DummyDirEntry) Type() fs.FileMode
Click to show internal directories.
Click to hide internal directories.