utils

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Digest256

func Digest256(str string) string

Digest256 returns a sha256 hash of the input string. The hash is represented as a hexadecimal string of length 64.

func Digest32

func Digest32(str string) string

Digest32 returns a 32-bit hash of the input string. The hash is represented as a hexadecimal string of length 8.

func GetHashedName

func GetHashedName(nsName string, length int) string

GetHashedName returns a partially hashed name for the string including up to the given length of the original name characters before the hash. Input `nsName` should be formatted as `{Namespace}/{ResourceName}`.

func NamespacedName

func NamespacedName(obj client.Object) types.NamespacedName

NamespacedName creates and returns object's NamespacedName.

Types

type NamespacedNameWithGroupKind added in v1.0.2

type NamespacedNameWithGroupKind struct {
	types.NamespacedName
	schema.GroupKind
}

func GetNamespacedNameWithGroupKind added in v1.0.2

func GetNamespacedNameWithGroupKind(obj client.Object) NamespacedNameWithGroupKind

GetNamespacedNameWithGroupKind creates and returns object's NamespacedNameWithGroupKind.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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