utils

package
v0.0.0-...-3c1c031 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Day  = 24 * time.Hour
	Week = 7 * Day

	InlineQueryFailureCacheTime = 2 // In seconds

	UserAgent = "Mozilla/5.0 (Windows NT 11.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
)

Variables

This section is empty.

Functions

func DefaultSendOptions

func DefaultSendOptions() *gotgbot.SendMessageOpts

func EmbedGUID

func EmbedGUID(guid string) string

func Escape

func Escape(s string) string

func FormatFloat

func FormatFloat(f float64) string

func FormatThousand

func FormatThousand[T constraints.Integer](n T) string

func FullName

func FullName(firstName, lastName string) string

func GermanTimezone

func GermanTimezone() *time.Location

func HumanizeDuration

func HumanizeDuration(d *duration.Duration) string

func HumanizeSize

func HumanizeSize(size int64) string

func LocalizeDatestring

func LocalizeDatestring(date string) string

func RoundAndFormatThousand

func RoundAndFormatThousand(n float64) string

func TimestampToTime

func TimestampToTime(timestamp int64) time.Time

Types

type VersionInfo

type VersionInfo struct {
	GoVersion  string
	GoOS       string
	GoArch     string
	Revision   string
	LastCommit time.Time
	DirtyBuild bool
}

func ReadVersionInfo

func ReadVersionInfo() (VersionInfo, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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