utils

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAsciiMeterCurrentTotal

func BuildAsciiMeterCurrentTotal(portion uint32, total uint32, width int) string

BuildAsciiMeterCurrentTotal builds a one-line meter using the amount and total values limited to the given width

func FormatBytes

func FormatBytes(i int64) string

FormatBytes formats an *int64 into a string with size suffix

func FormatLocalDate

func FormatLocalDate(when time.Time) string

FormatLocalDate formats a date with the local time zone

func FormatLocalDateTime

func FormatLocalDateTime(when time.Time) string

FormatLocalDateTime formats a datetime with the local time zone

func FormatLocalTime

func FormatLocalTime(when time.Time) string

FormatLocalTime formats a time with the local time zone

func I32ToString

func I32ToString(i int32) string

I32ToString renders an int32 into a string

func I64ToString

func I64ToString(i int64) string

I64ToString renders an int64 into a string

func LowerTitle

func LowerTitle(s string) string

LowerTitle renders a string to lower title case (all lower case except for initial chars in each word)

func RemoveAllBeforeLastChar

func RemoveAllBeforeLastChar(delimiter string, src *string) string

RemoveAllBeforeLastChar removes all characaters before and including delimiter

func TakeLeft

func TakeLeft(s string, max int) string

TakeLeft returns the left x chars from a string and hack

Types

This section is empty.

Jump to

Keyboard shortcuts

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