helpers

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeLayout = time.RFC3339
)

Variables

This section is empty.

Functions

func CmpResourceList added in v0.6.1

func CmpResourceList(a corev1.ResourceList, b corev1.ResourceList) int

func CmpResourceRequirements added in v0.4.1

func CmpResourceRequirements(a corev1.ResourceRequirements, b corev1.ResourceRequirements) int

func ConsecutiveIntsToRange added in v1.0.2

func ConsecutiveIntsToRange(ints []int32) string

ConsecutiveIntsToRange takes a list of sorted integers and returns string representation of its range ConsecutiveIntsToRange(0,1,2,3,4,5,6) -> 0-6 ConsecutiveIntsToRange(12,13,14,15,16) -> 12-16

func EnsureValidLabelValue added in v1.0.2

func EnsureValidLabelValue(s string) string

func GomaxprocsFromResource added in v0.4.0

func GomaxprocsFromResource(cpu *resource.Quantity) string

func GomemlimitFromResource added in v1.1.0

func GomemlimitFromResource(memory *resource.Quantity) string

func Int2Str added in v0.9.1

func Int2Str(ints []int32) []string

func MapToArray added in v0.9.1

func MapToArray(data map[int32]bool) []int32

func ParseIntAnnotation added in v0.9.1

func ParseIntAnnotation(key string) (int32, error)

func ParsePartitionsListAnnotation added in v0.9.1

func ParsePartitionsListAnnotation(partitions string) ([]int32, error)

func ParseTimeAnnotation added in v0.4.1

func ParseTimeAnnotation(ts string) (time.Time, error)

func PopulateEnv added in v0.4.0

func PopulateEnv(currentEnv []corev1.EnvVar, resources *corev1.ResourceRequirements, envKey string, partitions []int32, id, numPartitions, numInstances int) []corev1.EnvVar

func PrettyPrintResources added in v0.4.0

func PrettyPrintResources(r *corev1.ResourceRequirements) string

func Ptr added in v1.1.2

func Ptr[T any](v T) *T

func SetEnv added in v0.4.0

func SetEnv(env []corev1.EnvVar, key string, value string) []corev1.EnvVar

func SplitIntoBuckets added in v0.9.1

func SplitIntoBuckets(size int32, desiredBucketSize int32) (buckets [][]int32)

SplitIntoBuckets takes array size and group size and returns array of arrays e.g.

SplitIntoBuckets(10, 3) -> [0,1,2] [3,4,5] [6,7] [8,9]
SplitIntoBuckets(12, 3) -> [0,1,2] [3,4,5] [6,7,8] [9,10,11]

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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