Documentation
¶
Index ¶
- Constants
- func Abs(v int) int
- func Ceil(a, b int) int
- func Clamp(v, low, high int) int
- func DivMod(numerator, denominator int) (quotient, remainder int)
- func HumanizeBytes(bytes uint64) string
- func HumanizeBytesGeneric[T Number](bytes T) string
- func HumanizeCorrupt(bytes int64) string
- func HumanizeDuration(duration time.Duration) string
- func HumanizeLimit(limit int64, isLimited bool) string
- func HumanizePrivary(isPrivate bool) string
- func HumanizeTime(torrentTime time.Time) string
- func LjustText(text string, maxWidth uint) string
- func Max(a, b int) int
- func Min(a, b int) int
- func TruncateText(text string, maxWidth uint, tail string) string
- type Number
Constants ¶
View Source
const (
Ellipsis = "…"
)
Variables ¶
This section is empty.
Functions ¶
func HumanizeBytes ¶
FIXME: a better way to do this that is also compatible with FuncMaps
func HumanizeBytesGeneric ¶
https://stackoverflow.com/questions/67678331/how-to-write-a-generic-function-that-accepts-any-numerical-type https://stackoverflow.com/questions/71274361/go-error-cannot-use-generic-type-without-instantiation
func HumanizeCorrupt ¶
func HumanizeDuration ¶
taken from - https://gist.github.com/harshavardhana/327e0577c4fed9211f65
func HumanizeLimit ¶
func HumanizePrivary ¶
func HumanizeTime ¶
Types ¶
type Number ¶
type Number interface { constraints.Integer | constraints.Float }
Click to show internal directories.
Click to hide internal directories.