textkit

package
v0.0.0-...-9e9b37c Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShortNumber

func ShortNumber(number int) string

ShortNumber makes a number very short

func Shorten

func Shorten(input string, maxLength int, ellipsis bool) string

Shorten makes the given input string fit the max length, and optionally appends "..." (ellipsis)

func TimeAgo

func TimeAgo(t time.Time) string

TimeAgo returns a short time ago string

func TimeAgoUTC

func TimeAgoUTC(t time.Time) string

TimeAgoUTC returns a short time ago string for an UTC time

func TimeStamp

func TimeStamp(t time.Time) string

TimeStamp returns an absolute timestamp

Types

type StringWriter

type StringWriter interface {
	Write(v []byte) (int, error)
	WriteString(value string) (int, error)
}

Jump to

Keyboard shortcuts

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