search

package
v1.48.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSemVer

func CheckSemVer(version string, constraint string) bool

Compare a version to a semantic version constraint using the [Masterminds semver constraints](https://github.com/Masterminds/semver?tab=readme-ov-file#checking-version-constraints). Provide a version string and a constraint and if the semver is within the constraint a boolean response of whether the version is constrained or not will occur. Any errors from the constraint or version will propagate through the framework errors and the value will be false.

func XPath

func XPath(document, path string) (string, bool)

XPath returns a single HTML XPath match inner text, allowing the extraction of HTML nodes and attributes. This is useful in situations where you might reach for regular expressions, but want to have a bit more reliability if the HTML document is consistent. The function will return an empty string and false boolean if the HTML node cannot be found or the XPath query is invalid, the latter of which should only occur during development.

func XPathAll

func XPathAll(document, path string) ([]string, bool)

XPathAll returns all matched HTML XPath match inner text. This can be used in scenarios that it is necessary to extract multiple values from matching HTML documents.

Types

This section is empty.

Jump to

Keyboard shortcuts

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