utils

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAsciiMeterCurrentTotal

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

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

func FormatLocalDate

func FormatLocalDate(when time.Time) string

Formats a time with the local time zone including date

func FormatLocalDateTimeAmPmZone

func FormatLocalDateTimeAmPmZone(when time.Time) string

Formats a time with the local time zone including date, time, am/pm, and zone

func FormatLocalTimeAmPmSecs

func FormatLocalTimeAmPmSecs(when time.Time) string

Formats a time with the local time zone including time and am/pm

func I64ToString

func I64ToString(i int64) string

Renders an int64 to a string

func LowerTitle

func LowerTitle(s string) string

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

func RemoveAllRegex

func RemoveAllRegex(pattern string, src string) string

Removes all regex matches in a string

func ReplaceAllRegex

func ReplaceAllRegex(pattern string, src string, replace string) string

Replaces all regex matches in a string

func TakeLeft

func TakeLeft(s string, max int) string

Returns the left x chars from a string

func TakeRight

func TakeRight(s string, max int) string

Returns the right x chars from a string

func ToLocalTime

func ToLocalTime(when time.Time) time.Time

Converts a Time instance to the local time zone

Types

This section is empty.

Jump to

Keyboard shortcuts

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