utilities

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

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

Go to latest
Published: Jun 14, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IsAlphabetic = regexp.MustCompile(`^[A-Za-z]+$`).MatchString

Functions

func FormatDate

func FormatDate(unixTime uint64) string

func FormatDuration

func FormatDuration(seconds uint64) string

func FormatHumanReadable

func FormatHumanReadable(b int64) string

func HumanizeUrl

func HumanizeUrl(uri string) string

func IsBlank

func IsBlank(text string) bool

func Redirect

func Redirect(uri string) string

func RewriteProxied

func RewriteProxied(uri string) string

func TakeN

func TakeN(text string, count int) string

func Test

func Test[A, W comparable](tests []TestSuite[A, W], toTest func(A) W, log func(W, W))

func WaitTimeout

func WaitTimeout(wg *sync.WaitGroup, timeout time.Duration) bool

Waits the given duration or otherwise times out if the the time gets exceeded

Types

type TestSuite

type TestSuite[A, W any] struct {
	Args A
	Want W
}

A single test suite.

Jump to

Keyboard shortcuts

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