utils

package
v1.2.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	StepNameHashLength = 10

	S3 taxonomy.ConnectionType = "s3"
)

Variables

This section is empty.

Functions

func HasString

func HasString(value string, values []string) bool

func Hash

func Hash(value string, hashLength int) string

Hash generates a name based on the unique identifier

func HelmConformName

func HelmConformName(name string) string

Helm has stricter restrictions than K8s and restricts release names to 53 characters

func Intersection

func Intersection(set1, set2 []string) []string

Intersection finds a common subset of two given sets of strings

func IsPathExists

func IsPathExists(path string) bool

Given a path this function returns true if such path exists. Otherwise it returns false.

func K8sConformName

func K8sConformName(name string) string

Some k8s objects only allow for a length of 63 characters. This method shortens the name keeping a prefix and using the last 5 characters of the new name for the hash of the postfix.

func ListeningAddress

func ListeningAddress(port int) string

func ShortenedName

func ShortenedName(name string, maxLength, hashLength int) string

This function shortens a name to the maximum length given and uses rest of the string that is too long as hash that gets added to the valid name.

func StructToMap

func StructToMap(data interface{}) (map[string]interface{}, error)

StructToMap converts a struct to a map using JSON marshal

Types

This section is empty.

Jump to

Keyboard shortcuts

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