Documentation ¶
Index ¶
- Constants
- Variables
- func Convert(source interface{}, target interface{})
- func ConvertStructToMap(in interface{}) map[string]string
- func DurationToDateTime(timeData uint64) time.Time
- func EntryIdToString(id cron.EntryID) string
- func FloatConv(num float64) float64
- func GetACHttpRequest() *resty.Request
- func GetDirSize(path string) (int64, error)
- func GetGVR(clientSet *kubernetes.Clientset, gvk schema.GroupVersionKind) (schema.GroupVersionResource, error)
- func GetTimeDurationString(startTime string, endTime string) string
- func HttpClient(method string, url string, payload io.Reader, token string) ([]byte, error)
- func HttpClientStatusCode(method string, url string, payload io.Reader, token string) (int, error)
- func HttpClientWithBodyAndCode(method string, url string, payload io.Reader, token string) (int, []byte, error)
- func HttpClientWithQueries[T any](method string, url string, payload io.Reader, token string, param T) ([]byte, error)
- func HttpClientWithScreen(method string, url string, payload io.Reader) (int, []byte, error)
- func HttpGet(method string, url string) ([]byte, error)
- func HttpPost(url string, data interface{}) (content string, err error)
- func Int64ToString(value int64) string
- func K8sUnstructured(dataString string, target interface{})
- func NewHttpsClient() *resty.Client
- func PathExists(path string) (bool, error)
- func RemoveDuplication_map(arr []string) []string
- func RunTimeToSeconds(runTime string) int
- func StringToInt(value string) int
- func TimeRemoveZone(tm time.Time) time.Time
- func TimeStringRemoveZone(tm string) string
- func TimeStringToGoTime(tm string) time.Time
- func UnMarshalK8sStruct(yamlString string, taskId int64) model.Cloud
- func Yaml2struct(fileHeader *multipart.FileHeader, req interface{}) error
Constants ¶
View Source
const ( GET = "GET" PUT = "PUT" POST = "POST" DELETE = "DELETE" )
View Source
const ( ContentType = "Content-Type" ApplicationJson = "application/json" ApplicationFromUrlencoded = "application/x-www-from-urlencoded" )
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 GetACHttpRequest ¶
func GetACHttpRequest() *resty.Request
func GetGVR ¶
func GetGVR(clientSet *kubernetes.Clientset, gvk schema.GroupVersionKind) (schema.GroupVersionResource, error)
GetGVR 获取GVR
func HttpClient ¶
func HttpClientStatusCode ¶
func HttpClientWithBodyAndCode ¶
func HttpClientWithQueries ¶
func HttpClientWithScreen ¶
func HttpPost ¶
发送POST请求 url:请求地址,data:POST请求提交的数据,contentType:请求体格式,如:application/json content:请求放回的内容
func NewHttpsClient ¶
func NewHttpsClient() *resty.Client
func RemoveDuplication_map ¶
removeDuplication_map 去重数组
func Yaml2struct ¶
func Yaml2struct(fileHeader *multipart.FileHeader, req interface{}) error
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.