util

package
v0.3.27 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const MaxMessageLength = 2048

Variables

This section is empty.

Functions

func Batch added in v0.2.6

func Batch(elements []string, batchSize int) [][]string

func CloseToDeadline added in v0.2.13

func CloseToDeadline(ctx context.Context, tolerance time.Duration) bool

func ContainsString added in v0.1.21

func ContainsString(list []string, val string) bool

func DeepCopy added in v0.2.3

func DeepCopy(a map[string]string) map[string]string

func DeepCopyListUint32 added in v0.2.3

func DeepCopyListUint32(list []uint32) []uint32

func Equal added in v0.2.3

func Equal(a map[string]string, b map[string]string) bool

func FilterKeys added in v0.2.6

func FilterKeys(a map[string]string, keys []string) map[string]string

func FormatBinarySI added in v0.3.24

func FormatBinarySI(q int64) string

func GetClusterAvailableCapacity added in v0.2.4

func GetClusterAvailableCapacity(report *api.ClusterUsageReport) common.ComputeResources

GetClusterAvailableCapacity returns the total resource to be shared amongst queues. This is the total capacity avaliable to armada on schedulable nodes + the capacity currently in use on unschedulable nodes.

func GetClusterCapacity added in v0.2.4

func GetClusterCapacity(report *api.ClusterUsageReport) common.ComputeResources

GetClusterCapacity returns the total capacity on all nodes on a cluster, even if they are unschedulable.

func GetOrDefault

func GetOrDefault(m map[string]float64, key string, def float64) float64

func GetQueueReports added in v0.2.4

func GetQueueReports(report *api.ClusterUsageReport) []*api.QueueReport

func MergeMaps added in v0.2.3

func MergeMaps(a map[string]string, b map[string]string) map[string]string

func Min added in v0.2.6

func Min(a, b int) int

func NewULID

func NewULID() string

NewULID returns a new ULID for the current time generated from a global RNG. The ULID is returned as a string converted to lower-case to ensure it is a valid DNS subdomain name; see https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names

func RemoveNullsFromJson added in v0.3.20

func RemoveNullsFromJson(json []byte) []byte

func RemoveNullsFromString added in v0.3.20

func RemoveNullsFromString(s string) string

func StringFromUlid added in v0.3.0

func StringFromUlid(id ulid.ULID) string

StringFromUlid returns a string representation of a proto UUID. Because Kubernetes requires ids to be valid DNS subdomain names, the string is returned in lower-case; see https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names

func StringListToSet

func StringListToSet(list []string) map[string]bool

func SubtractStringList

func SubtractStringList(a []string, b []string) []string

func SumReportClusterCapacity added in v0.2.4

func SumReportClusterCapacity(reports map[string]*api.ClusterUsageReport) common.ComputeResources

func Truncate added in v0.3.20

func Truncate(s string, max int) string

func ULID added in v0.3.0

func ULID() ulid.ULID

ULID returns a new ULID for the current time generated from a global RNG.

Types

This section is empty.

Jump to

Keyboard shortcuts

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