Documentation ¶
Index ¶
- func BuildRegexpMatchMap(r HasSubexpNames, matches []string) map[string]string
- func CloseAndLogError(closer io.Closer)
- func EscapeName(input string) string
- func FloatPointersPointToSameValue(f1, f2 *float64) bool
- func FormatTable(rows [][]string) string
- func NewBool(v bool) *bool
- func NewString(v string) *string
- func TryParseInt64(s string) *int64
- func UnescapeName(input string) (string, error)
- type HasSubexpNames
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildRegexpMatchMap ¶
func BuildRegexpMatchMap(r HasSubexpNames, matches []string) map[string]string
BuildRegexpMatchMap creates a map from a regular expression, and a match slice obtained from r.FindStringSubmatch or r.FindAllStringSubmatch.
func CloseAndLogError ¶
CloseAndLogError closes the closer and logs any error it returns.
func EscapeName ¶
EscapeName takes an arbitrary string and maps it bijectively to the grammar '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'. This is useful when creating Kubernetes resources.
func FloatPointersPointToSameValue ¶
FloatPointersPointToSameValue returns true if and only if: 1. f1 and f2 are the same pointer value. 2. f1 and f2 are both not nil and the floats to which they point are equal (==) or are both NaN.
func FormatTable ¶
func TryParseInt64 ¶
TryParseInt64 is a convenience method to parse a string into an *int64, allowing only one or more ASCII digits and an optional sign prefix.
func UnescapeName ¶
UnescapeName performs the reverse transformation of EscapeName.
Types ¶
type HasSubexpNames ¶
type HasSubexpNames interface {
SubexpNames() []string
}