utils

package
v0.0.0-...-14e88fa Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ellipsis = "…"
)

Variables

This section is empty.

Functions

func Abs

func Abs(v int) int

func Ceil

func Ceil(a, b int) int

func Clamp

func Clamp(v, low, high int) int

func DivMod

func DivMod(numerator, denominator int) (quotient, remainder int)

func HumanizeBytes

func HumanizeBytes(bytes uint64) string

FIXME: a better way to do this that is also compatible with FuncMaps

func HumanizeCorrupt

func HumanizeCorrupt(bytes int64) string

func HumanizeLimit

func HumanizeLimit(limit int64, isLimited bool) string

func HumanizePrivary

func HumanizePrivary(isPrivate bool) string

func HumanizeTime

func HumanizeTime(torrentTime time.Time) string

func LjustText

func LjustText(text string, maxWidth uint) string

func Max

func Max(a, b int) int

func Min

func Min(a, b int) int

func TruncateText

func TruncateText(text string, maxWidth uint, tail string) string

Types

type Number

type Number interface {
	constraints.Integer | constraints.Float
}

Jump to

Keyboard shortcuts

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