strutil

package
v0.55.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 6 Imported by: 1,920

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSyntax = errors.New("invalid syntax")

ErrSyntax indicates that a value does not have the right syntax for the target type.

Functions

func GraphLinkForExpression

func GraphLinkForExpression(expr string) string

GraphLinkForExpression creates an escaped relative link to the graph view of the provided expression.

func SanitizeFullLabelName added in v0.43.0

func SanitizeFullLabelName(name string) string

SanitizeFullLabelName replaces any invalid character with an underscore, and if given an empty string, returns a string containing a single underscore.

func SanitizeLabelName

func SanitizeLabelName(name string) string

SanitizeLabelName replaces anything that doesn't match client_label.LabelNameRE with an underscore. Note: this does not handle all Prometheus label name restrictions (such as not starting with a digit 0-9), and hence should only be used if the label name is prefixed with a known valid string.

func TableLinkForExpression

func TableLinkForExpression(expr string) string

TableLinkForExpression creates an escaped relative link to the table view of the provided expression.

func Unquote

func Unquote(s string) (t string, err error)

Unquote interprets s as a single-quoted, double-quoted, or backquoted Prometheus query language string literal, returning the string value that s quotes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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