util

package
v6.8.5 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsNonASCIICharacters

func ContainsNonASCIICharacters(ua string) bool

ContainsNonASCIICharacters returns whether the string only consists out of ASCII characters or not.

func PastDay

func PastDay(n int) time.Time

PastDay returns the date for today without time minus the given number of days at UTC.

func RandString

func RandString(n int) string

RandString returns a random string for given length.

func RandUint32

func RandUint32() uint32

RandUint32 returns a random uint32.

func RandUint64

func RandUint64() uint64

RandUint64 returns a random uint64.

func RunAtMidnight

func RunAtMidnight(f func()) context.CancelFunc

RunAtMidnight calls given function on each day of month on midnight (UTC), unless it is cancelled by calling the cancel function.

func ShortenString

func ShortenString(str string, n int) string

ShortenString shortens given string to the given maximum number of bytes.

func Today

func Today() time.Time

Today returns the date for today without time at UTC.

Types

This section is empty.

Jump to

Keyboard shortcuts

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