name

package
v0.7.0-rc.3-test3 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package name provides functions for truncating and hashing strings and for generating valid k8s resource names.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HelmReleaseName

func HelmReleaseName(str string) string

HelmReleaseName uses the provided string to create a unique name. The resulting name is DNS label safe (RFC1123) and complies with Helm's regex for release names.

func Hex

func Hex(s string, length int) string

Hex returns a hex-encoded hash of the string and truncates it to length. Warning: truncating the 32 character hash makes collisions more likely.

func Limit

func Limit(s string, count int) string

Limit the length of a string to count characters. If the string's length is greater than count, it will be truncated and a hash will be appended to the end. If count is too small to include the shortened hash the string is simply truncated.

Types

This section is empty.

Jump to

Keyboard shortcuts

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