util

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPrefixGameKruise

func AddPrefixGameKruise(s string) string

func DeepHashObject

func DeepHashObject(hasher hash.Hash, objectToWrite interface{})

DeepHashObject writes specified object to hash using the spew library which follows pointers and prints actual values of the nested objects ensuring the hash does not change when a pointer changes.

func GetAstsHash

func GetAstsHash(gss *gameKruiseV1alpha1.GameServerSet) string

func GetGameServerSetOfPod added in v0.2.0

func GetGameServerSetOfPod(pod *corev1.Pod, c client.Client, ctx context.Context) (*gameKruiseV1alpha1.GameServerSet, error)

func GetHash

func GetHash(objectToWrite interface{}) string

func GetIndexFromGsName

func GetIndexFromGsName(gsName string) int

func GetIndexListFromGsList

func GetIndexListFromGsList(gsList []gameKruiseV1alpha1.GameServer) []int

func GetIndexListFromPodList

func GetIndexListFromPodList(podList []corev1.Pod) []int

func GetPodConditionFromList

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

GetPodConditionFromList extracts the provided condition from the given list of condition and returns the index of the condition and the condition. Returns -1 and nil if the condition is not present.

func GetSliceInANotInB

func GetSliceInANotInB(a, b []int) []int

func GetSliceInAandInB

func GetSliceInAandInB(a, b []int) []int

func Int32SliceToString added in v0.2.0

func Int32SliceToString(number []int32, delimiter string) string

func IntSliceToString

func IntSliceToString(number []int, delimiter string) string

func IsHasNegativeNum

func IsHasNegativeNum(nums []int) bool

func IsNumInList

func IsNumInList(num int, list []int) bool

func IsRepeat

func IsRepeat(nums []int) bool

func IsSliceEqual

func IsSliceEqual(a, b []int) bool

func IsStringInList

func IsStringInList(str string, list []string) bool

func RemovePrefixGameKruise

func RemovePrefixGameKruise(s string) string

func RemoveRepeat

func RemoveRepeat(nums []int) []int

func StringToInt32Slice added in v0.2.0

func StringToInt32Slice(str string, delimiter string) []int32

func StringToIntSlice

func StringToIntSlice(str string, delimiter string) []int

Types

type DeleteSequenceGs

type DeleteSequenceGs []corev1.Pod

func (DeleteSequenceGs) Len

func (dg DeleteSequenceGs) Len() int

func (DeleteSequenceGs) Less

func (dg DeleteSequenceGs) Less(i, j int) bool

func (DeleteSequenceGs) Swap

func (dg DeleteSequenceGs) Swap(i, j int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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