utils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chunks added in v0.0.18

func Chunks[T any](in []T, size int) [][]T

func FindPodStatusCondition added in v1.0.4

func FindPodStatusCondition(conditions []corev1.PodCondition, conditionType corev1.PodConditionType) *corev1.PodCondition

Copied from: k8s.io/apimachinery/pkg/apis/meta

func GetNewConditions added in v0.0.16

func GetNewConditions(conditions []v1.Condition, newCond v1.Condition) []v1.Condition

func LatticeServiceName added in v0.0.17

func LatticeServiceName(k8sSourceRouteName string, k8sSourceRouteNamespace string) string

func PodHasReadinessGate added in v1.0.4

func PodHasReadinessGate(pod *corev1.Pod, conditionType corev1.PodConditionType) bool

func RandomAlphaString added in v1.0.3

func RandomAlphaString(length int) string

func SetPodStatusCondition added in v1.0.4

func SetPodStatusCondition(conditions *[]corev1.PodCondition, newCondition corev1.PodCondition)

Copied from: k8s.io/apimachinery/pkg/apis/meta

func SliceFilter added in v0.0.17

func SliceFilter[T any](in []T, f FilterFunc[T]) []T

func SliceMap added in v0.0.16

func SliceMap[T any, U any](in []T, f MapFunc[T, U]) []U

func SliceMapToPtr added in v1.0.2

func SliceMapToPtr[T any](in []T) []*T

func TargetRefToLatticeResourceName added in v0.0.18

func TargetRefToLatticeResourceName(
	targetRef *gwv1alpha2.NamespacedPolicyTargetReference,
	parentNamespace string,
) (string, error)

func Truncate added in v0.0.13

func Truncate(name string, length int) string

Types

type FilterFunc added in v0.0.17

type FilterFunc[T any] func(T) bool

type MapFunc added in v0.0.16

type MapFunc[T any, U any] func(T) U

type Set added in v1.0.2

type Set[T comparable] struct {
	// contains filtered or unexported fields
}

func NewSet added in v1.0.2

func NewSet[T comparable](objs ...T) Set[T]

func (*Set[T]) Contains added in v1.0.2

func (s *Set[T]) Contains(t T) bool

func (*Set[T]) Delete added in v1.0.2

func (s *Set[T]) Delete(t T)

func (*Set[T]) Items added in v1.0.2

func (s *Set[T]) Items() []T

func (*Set[T]) Put added in v1.0.2

func (s *Set[T]) Put(t T)

Directories

Path Synopsis
Package retry is a retry with backoff implementation
Package retry is a retry with backoff implementation

Jump to

Keyboard shortcuts

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