util

package
v0.57.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 10 Imported by: 31

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalAddr

func CanonicalAddr(host string, port int) (addr string)

func ConstantTimeEqString added in v0.49.0

func ConstantTimeEqString(a, b string) bool

func EmptyOr added in v0.52.0

func EmptyOr[T comparable](v T, fallback T) T

func GenerateResponseErrorString

func GenerateResponseErrorString(summary string, err error, detailed bool) string

func GetAuthKey

func GetAuthKey(token string, timestamp int64) (key string)

func ParseRangeNumbers

func ParseRangeNumbers(rangeStr string) (numbers []int64, err error)

func RandID

func RandID() (id string, err error)

RandID return a rand string used in frp.

func RandIDWithLen

func RandIDWithLen(idLen int) (id string, err error)

RandIDWithLen return a rand string with idLen length.

func RandomSleep added in v0.40.0

func RandomSleep(duration time.Duration, minRatio, maxRatio float64) time.Duration

Types

This section is empty.

Jump to

Keyboard shortcuts

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