Documentation ¶
Index ¶
- Variables
- func Convert(source interface{}, target interface{})
- func ConvertStructToMap(in interface{}) map[string]string
- func EntryIdToString(id cron.EntryID) string
- func FloatConv(num float64) float64
- func GenSnowflakeID() int64
- func GetGVR(clientSet *kubernetes.Clientset, gvk schema.GroupVersionKind) (schema.GroupVersionResource, error)
- func GetParticipantId(filePath string) (int64, error)
- func InitSnowflake(machineID int64) (err error)
- func Int64ToString(value int64) string
- func K8sUnstructured(dataString string, target interface{})
- func RandomString(n int) string
- func RemoveDuplication_map(arr []string) []string
- func RunTimeToSeconds(runTime string) int
- func StringToFloat64(value string) float64
- func StringToInt(value string) int
- func StringToInt64(value string) int64
- func UpdateParticipantId(filePath string, value string) error
- func Yaml2struct(fileHeader *multipart.FileHeader, req interface{}) error
- type PConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var Converters = []copier.TypeConverter{ { SrcType: time.Time{}, DstType: copier.String, Fn: func(src interface{}) (interface{}, error) { s, ok := src.(time.Time) if !ok { return nil, errors.New("src type not matching") } return s.Format(time.RFC3339), nil }, }, { SrcType: copier.String, DstType: copier.Int, Fn: func(src interface{}) (interface{}, error) { s, ok := src.(string) if !ok { return nil, errors.New("src type not matching") } return strconv.Atoi(s) }, }, { SrcType: copier.String, DstType: copier.Bool, Fn: func(src interface{}) (interface{}, error) { s, ok := src.(string) if !ok { return nil, errors.New("src type not matching") } return strconv.ParseBool(s) }, }, }
Functions ¶
func ConvertStructToMap ¶
func GetGVR ¶
func GetGVR(clientSet *kubernetes.Clientset, gvk schema.GroupVersionKind) (schema.GroupVersionResource, error)
GetGVR 获取GVR
func GetParticipantId ¶
GetParticipantId 获取本地配置文件中的ParticipantId
func InitSnowflake ¶
func K8sUnstructured ¶
func K8sUnstructured(dataString string, target interface{})
func RandomString ¶
func RemoveDuplication_map ¶
removeDuplication_map 去重数组
func RunTimeToSeconds ¶
func StringToFloat64 ¶
func StringToInt ¶
func StringToInt64 ¶
func UpdateParticipantId ¶
UpdateParticipantId 更新本地配置文件ParticipantId
func Yaml2struct ¶
func Yaml2struct(fileHeader *multipart.FileHeader, req interface{}) error
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.