Documentation ¶
Index ¶
- func BoolPtr(b bool) *bool
- func DecodeBase64(encoded string) (string, error)
- func DeepCopy[T any](src T) (T, error)
- func EncodeBase64(str string) string
- func Int32Ptr(i int32) *int32
- func Int64Ptr(i int64) *int64
- func IsTextFile(ob []byte) (bool, error)
- func MustDecodeBase64(encoded string) string
- func RandNDigitInt(n int) int
- func RandNLengthString(n int) string
- func SanitizeFileName(filename string) string
- func ToInt(s string) int
- func ToInt64(str string) int64
- func ToInt64Slice(ids string) []int64
- func ToIntDefault(s string, i int) int
- func ToIntSlice(ids string) []int
- func ToJSON(v interface{}) string
- func ToUInt(s string) uint
- func TruncateString(s string, length int) string
- func UpdateImageName(imageName string, imagePrefix string) string
- type LabelsManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeBase64 ¶
func IsTextFile ¶
func MustDecodeBase64 ¶
func RandNDigitInt ¶
RandNDigitInt generates a random number with n digits
func RandNLengthString ¶
RandNLengthString generates a random string of specified length using the default charset
func SanitizeFileName ¶
SanitizeFileName 去除文件名中的非法字符,并替换为下划线 '_'
func ToInt64Slice ¶
func ToIntDefault ¶
func TruncateString ¶
func UpdateImageName ¶
UpdateImageName 检查镜像名称是否包含前缀,只能是harbor.power.sd.k9s.space 是否已harbor.power.sd.k9s.space开头,是,没问题。 否,检查是否有其他前缀,删除,替换为harbor.power.sd.k9s.space 没有,增加harbor.power.sd.k9s.space前缀 检查镜像名称是否已以指定前缀开头
Types ¶
type LabelsManager ¶
LabelsManager 结构体,包含共享标签
func NewLabelsManager ¶
func NewLabelsManager(labels map[string]string) *LabelsManager
NewLabelsManager 构造函数,初始化并返回一个 LabelsManager
func (*LabelsManager) AddCustomLabel ¶
func (lm *LabelsManager) AddCustomLabel(meta *metav1.ObjectMeta, key, value string)
AddCustomLabel 动态添加用户指定的标签
func (*LabelsManager) AddLabels ¶
func (lm *LabelsManager) AddLabels(meta *metav1.ObjectMeta)
AddLabels 给任意 Kubernetes 资源对象添加共享标签
Source Files ¶
Click to show internal directories.
Click to hide internal directories.