Documentation ¶
Index ¶
- Variables
- func Convert(source interface{}, target interface{})
- func ConvertStructToMap(in interface{}) map[string]string
- func Delete(token, endpoint, url string, pathParams *map[string]string, body *string, ...) (*resty.Response, error)
- func EntryIdToString(id cron.EntryID) string
- func FloatConv(num float64) float64
- func GenSnowflakeID() int64
- func Get(token, endpoint, url string, pathParams *map[string]string, ...) (*resty.Response, error)
- func GetCallFunc() string
- 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 NewRequest(token string, endpoint string, cli *resty.Client) (*resty.Request, error)
- func Post(token, endpoint, url string, contentType string, pathParams *map[string]string, ...) (*resty.Response, error)
- func RandomString(n int) string
- func RemoveDuplication_map(arr []string) []string
- func ResponseWithLog(ctx *context.Context, funcName string, req *resty.Request, ...) (*resty.Response, error)
- 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 Cli
- 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 Delete ¶
func Delete(token, endpoint, url string, pathParams *map[string]string, body *string, resultData interface{}) (*resty.Response, error)
Delete 方法
func Get ¶
func Get(token, endpoint, url string, pathParams *map[string]string, queryParams *map[string]string, resultData interface{}) (*resty.Response, error)
Get 方法
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 NewRequest ¶
NewRequest 构造一个请求
func Post ¶
func Post(token, endpoint, url string, contentType string, pathParams *map[string]string, fileParams *map[string]string, queryParams *map[string]string, body *string, formData *map[string]string, resultData interface{}) (*resty.Response, error)
Post
func RandomString ¶
func RemoveDuplication_map ¶
removeDuplication_map 去重数组
func ResponseWithLog ¶
func ResponseWithLog(ctx *context.Context, funcName string, req *resty.Request, result *resty.Response, err error) (*resty.Response, error)
提取错误信息并记录日志
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.