utils

package
v0.0.0-...-74587f1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyPeerWithRetry

func ApplyPeerWithRetry(client clientset.Interface, peer *v1alpha1.Peer) error

ApplyEndPointSliceWithRetry create or update existed slices.

func ContainsPrefix

func ContainsPrefix(slice []string, s string) bool

ContainsPrefix checks if a given slice of strings start with the provided string.

func ContainsString

func ContainsString(slice []string, s string) bool

ContainsString checks if a given slice of strings contains the provided string.

func CopyStrings

func CopyStrings(s []string) []string

CopyStrings copies the contents of the specified string slice into a new slice.

func DeletePeerWithRetry

func DeletePeerWithRetry(client clientset.Interface, name, namespace string) error

func DerivedName

func DerivedName(clusterID, namespace, seName string) string

func MaxInt

func MaxInt(a, b int) int

func MaxInt32

func MaxInt32(a, b int32) int32

func MinInt

func MinInt(a, b int) int

func MinInt32

func MinInt32(a, b int32) int32

func RemoveString

func RemoveString(slice []string, s string) []string

RemoveString returns a newly created []string that contains all items from slice that are not equal to s.

func ResourceNeedResync

func ResourceNeedResync(current pkgruntime.Object, modified pkgruntime.Object, ignoreAdd bool) bool

current is deployed resource, modified is changed resource. ignoreAdd is true if you want to ignore add action. The function will return the bool value to indicate whether to sync back the current object.

func SortStrings

func SortStrings(s []string) []string

SortStrings sorts the specified string slice in place. It returns the same slice that was provided in order to facilitate method chaining.

func SumArrayInt32

func SumArrayInt32(array []int32) (sum int32)

Types

This section is empty.

Jump to

Keyboard shortcuts

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