Documentation ¶
Overview ¶
Copyright 2023 KubeAGI.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
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 ParseBase64ImageBytes(img string) ([]byte, error)
- func RFC3339Time(timeStr string) (time.Time, error)
- func RemoveString(finalizers []string, f string) []string
Constants ¶
const ( KB = 1024 MB = KB * 1024 GB = MB * 1024 )
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 ParseBase64ImageBytes ¶ added in v0.2.2
func RFC3339Time ¶
RFC3339Time parses a time string to a Time with RFC3339 format
func RemoveString ¶
Types ¶
This section is empty.