utils

package
v2.0.43 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(s []string, e string) bool

func ConvertCamelCaseToKebabCase

func ConvertCamelCaseToKebabCase(name string) string

ConvertCamelCaseToKebabCase rewrites a string written in camel case (e.g. PenPineappleApplePen) in kebab case (pen-pineapple-apple-pen)

func ConvertToDNS1123SubdomainCompatibleString

func ConvertToDNS1123SubdomainCompatibleString(name string) string

ConvertToDNS1123SubdomainCompatibleString converts a string that doesn't conform to the definition of a subdomain in DNS (RFC 1123) to a string that conforms. It doesn't do well on labels (separated by dots) starting or ending with hyphens.

func CopyMap

func CopyMap(o map[string]string) (r map[string]string)

func MarshalObjToStruct deprecated

func MarshalObjToStruct(input interface{}) (*structpb.Struct, error)

Deprecated: Use flytestdlib/utils.MarshalObjToStruct instead. Don't use this if input is a proto Message.

func MarshalStruct deprecated

func MarshalStruct(in proto.Message, out *structpb.Struct) error

Deprecated: Use flytestdlib/utils.MarshalPbToStruct instead.

func MarshalToString deprecated

func MarshalToString(msg proto.Message) (string, error)

Deprecated: Use flytestdlib/utils.MarshalToString instead.

func SanitizeLabelValue added in v2.0.43

func SanitizeLabelValue(value string) string

SanitizeLabelValue coerces an arbitrary string into a valid Kubernetes label value: at most 63 characters, made up of alphanumerics, dots, dashes and underscores, and beginning and ending with an alphanumeric character. An empty input stays empty so callers can decide whether to stamp the label at all.

func UnionMaps

func UnionMaps(maps ...map[string]string) map[string]string

This function unions a list of maps (each can be nil or populated) by allocating a new map. Conflicting keys will always defer to the later input map's corresponding value.

func UnmarshalStruct deprecated

func UnmarshalStruct(structObj *structpb.Struct, msg proto.Message) error

Deprecated: Use flytestdlib/utils.UnmarshalStructToPb instead.

func UnmarshalStructToObj deprecated

func UnmarshalStructToObj(structObj *structpb.Struct, obj interface{}) error

Deprecated: Use flytestdlib/utils.UnmarshalStructToObj instead. Don't use this if the unmarshalled obj is a proto message.

Types

type ErrorCollection

type ErrorCollection struct {
	Errors []error
}

func (ErrorCollection) Error

func (e ErrorCollection) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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