Documentation
¶
Index ¶
- Constants
- func AddOrSwapString(strings []string, str string) (bool, []string)
- func AddString(finalizers []string, f string) []string
- func BytesToSizedStr(bytes int64) string
- func ContainString(finalizers []string, f string) bool
- func GetCurrentNamespace() string
- func RFC3339Time(timeStr string) (time.Time, error)
- func RemoveString(finalizers []string, f string) []string
- func UnstructuredToStructured(unstructuredObj *unstructured.Unstructured, target any) error
- func ValidateClient(c client.Client, cli dynamic.Interface) error
Constants ¶
View Source
const ( KB = 1024 MB = KB * 1024 GB = MB * 1024 )
View Source
const (
EnvNamespaceKey = "POD_NAMESPACE"
)
Variables ¶
This section is empty.
Functions ¶
func AddOrSwapString ¶
AddOrSwapString Add an element to the string array, swap it with the last element if it is in the array, or append it directly to the end if it does not exist. Gives whether the array has changed
Example:
[], "a" -> true, []string{"a"}
["a"], "b" -> true, []string{"a", "b"}
["a", "b"], "a" -> true, []string{"b", "a"}
["a", "b", "a"], "a" -> false, []string{"a", "b", "a"}
func BytesToSizedStr ¶
BytesToSize converts size(byte as the unit) to string with appropriate unit ending
func ContainString ¶
func GetCurrentNamespace ¶
func GetCurrentNamespace() string
func RFC3339Time ¶
RFC3339Time parses a time string to a Time with RFC3339 format
func RemoveString ¶
func UnstructuredToStructured ¶
func UnstructuredToStructured(unstructuredObj *unstructured.Unstructured, target any) error
UnstructuredToStructured convert unstructured object to a structured target(must be a pointer)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.