Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Deprecated: Use github.com/happy-sdk/happy/pkg/bytesize instead. Byte = 1 << (iota * 10) // Deprecated: Use github.com/happy-sdk/happy/pkg/bytesize instead. KiByte // Deprecated: Use github.com/happy-sdk/happy/pkg/bytesize instead. MiByte // Deprecated: Use github.com/happy-sdk/happy/pkg/bytesize instead. GiByte // Deprecated: Use github.com/happy-sdk/happy/pkg/bytesize instead. TiByte // Deprecated: Use github.com/happy-sdk/happy/pkg/bytesize instead. PiByte // Deprecated: Use github.com/happy-sdk/happy/pkg/bytesize instead. EiByte )
View Source
const ( // Deprecated: Use github.com/happy-sdk/happy/pkg/bytesize instead. IByte = 1 // Deprecated: Use github.com/happy-sdk/happy/pkg/bytesize instead. KByte = IByte * 1000 // Deprecated: Use github.com/happy-sdk/happy/pkg/bytesize instead. MByte = KByte * 1000 // Deprecated: Use github.com/happy-sdk/happy/pkg/bytesize instead. GByte = MByte * 1000 // Deprecated: Use github.com/happy-sdk/happy/pkg/bytesize instead. TByte = GByte * 1000 // Deprecated: Use github.com/happy-sdk/happy/pkg/bytesize instead. PByte = TByte * 1000 // Deprecated: Use github.com/happy-sdk/happy/pkg/bytesize instead. EByte = PByte * 1000 // Deprecated: Use github.com/happy-sdk/happy/pkg/bytesize instead. ZByte = EByte * 1000 )
Variables ¶
This section is empty.
Functions ¶
func Duration ¶ added in v0.4.0
Duration formats a time.Duration into a human-readable string. It supports both full and short formats.
func ParseBytes
deprecated
ParseBytes parses a string representation of bytes (like "1.5 GB" or "1024 B") and returns the number of bytes it represents. It supports both decimal (SI) and binary (IEC) units and handles values with commas as well.
Deprecated: Use github.com/happy-sdk/happy/pkg/bytesize.Parse(s) instead.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.