helpers

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: Apache-2.0 Imports: 7 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 GomaxprocsFromResource added in v0.4.0

func GomaxprocsFromResource(cpu *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 Ptr2Int32

func Ptr2Int32(i int32) *int32

func Ptr2Int64

func Ptr2Int64(i int64) *int64

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