utils

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 17 Imported by: 2

Documentation

Index

Constants

View Source
const Fractions = "¼½¾⅐⅑⅒⅓⅔⅕⅖⅗⅘⅙⅚⅛⅜⅝⅞"

Variables

This section is empty.

Functions

func AppendUnique

func AppendUnique[E comparable](s []E, v E) []E

func BaseUrl

func BaseUrl(urlStr string) string

func Cleanup

func Cleanup(s string) string

func CleanupInline

func CleanupInline(s string) string

func CleanupLang

func CleanupLang(lang string) string

func Deduplicate

func Deduplicate[E comparable](s []E) []E

func DomainZone

func DomainZone(urlStr string) string

func FindFloat

func FindFloat(val interface{}) float64

func FindInt

func FindInt(val interface{}) int

func FindNumber

func FindNumber(str string) float64

func FormatFraction

func FormatFraction(f float64) string

func HostAlias

func HostAlias(urlStr string) string

func Hostname

func Hostname(urlStr string) string

func IsAbsolute

func IsAbsolute(urlStr string) bool

func LanguageByDomain

func LanguageByDomain(tld string) (string, bool)

func Parse8601Duration added in v1.0.3

func Parse8601Duration(str string) time.Duration

func ParseDuration

func ParseDuration(str string) (time.Duration, bool)

func ParseFloat

func ParseFloat(str string) (float64, error)

func ParseFraction

func ParseFraction(str string) (float64, error)

func ParseInt

func ParseInt(str string) (int, error)

func ParseToMillis added in v1.0.2

func ParseToMillis(str string, baseOpt ...uint) uint

func ReadUrl

func ReadUrl(url string, headers http.Header) ([]byte, *url.URL, error)

func RemoveDoubleSpace

func RemoveDoubleSpace(str string) string

func RemoveNewLines

func RemoveNewLines(s string) string

func RemoveSpaces

func RemoveSpaces(s string) string

func RemoveTrailingSlash

func RemoveTrailingSlash(urlStr string) string

func SplitParagraphs

func SplitParagraphs(s string) []string

func SplitTitle

func SplitTitle(title string) []string

func ToAbsoluteUrl

func ToAbsoluteUrl(base *url.URL, urlStr string) string

func TrimZeroWidthSpaces

func TrimZeroWidthSpaces(s string) string

func Unquote

func Unquote(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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