utils

package
v0.35.3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: GPL-3.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandBuildProperties

func ExpandBuildProperties(props []string) ([]string, error)

ExpandBuildProperties expands the build properties placeholders in the slice of properties.

func Match

func Match(str string, substrings []string) bool

Match returns true if all substrings are contained in str. Both str and substrings are transforms to lower case and have their accents and other unicode diatrics removed. If strings transformation fails an error is returned.

func MatchAny

func MatchAny(query string, arrayToMatch []string) bool

MatchAny checks if query matches at least one of the string in arrayToMatch using the utils.Match function.

func SanitizeName

func SanitizeName(origName string) string

SanitizeName replaces with underscores all chars that are not included in the ranges: 0-9, A-Z, a-z, "-" and "."

func SearchTermsFromQueryString

func SearchTermsFromQueryString(query string) []string

SearchTermsFromQueryString returns the terms inside the query string. All non alphanumeric characters (expect ':') are considered separators. All search terms are converted to lowercase.

func URLParse

func URLParse(rawURL string) (*url.URL, error)

URLParse parses a raw URL string and handles local files URLs depending on the platform

Types

This section is empty.

Jump to

Keyboard shortcuts

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