utils

package
v0.0.0-...-1c783dc Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

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

	InlineQueryFailureCacheTime int64 = 2 // In seconds

	UserAgent = "Mozilla/5.0 (Windows NT 11.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.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 Ptr

func Ptr[T any](v T) *T

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