Versions in this module Expand all Collapse all v1 v1.0.0 Mar 10, 2022 Changes in this version + const DefaultHttpClientTimeout + var HttpClient = ...() + func BirthdayToAge(birthday string) (age int) + func Bytes2String(b []byte) string + func ClientIP(ip string) string + func CreateCaptcha(num int) string + func CurrentFileName() string + func CurrentMethodName() string + func DeepCopy(value interface{}) interface + func Difference(slice1, slice2 []int) []int + func DrainBody(b io.ReadCloser) (r1, r2 io.ReadCloser, err error) + func ExecShell(name string, arg ...string) ([]byte, error) + func FileIsExist(path string) bool + func FirstDayOfISOWeek(year int, week int, timezone *time.Location) time.Time + func GetIPByPconline(ip string) string + func GetMondayOfWeek(t time.Time, fmtStr string) (dayStr string) + func GetNextWeekMonday(t time.Time, fmtStr string) (day string, err error) + func GetTimeRemainSeconds(startTimeStr, endTimeStr string) int + func GetWeekDay(date string) string + func GetZeroTime(t time.Time) time.Time + func InArray(val interface{}, array interface{}) (exists bool, index int) + func Intersect(slice1 []int, slice2 []int) []int + func IoCopy(r io.Reader) ([]byte, error) + func MD5(str string) string + func Nl2br(str string, isXhtml bool) string + func NowTime(format ...string) string + func PublicIP() string + func RandFloat64(min, max float64, decimalNum int) float64 + func RandIntn(max int) int + func RemoveDuplicateWithInt(arr []int) []int + func RemoveDuplicateWithString(arr []string) []string + func RemoveWithInt(arr []int, in int) []int + func RemoveWithString(arr []string, in string) []string + func SafeCloseChan(ch chan interface{}) (closed bool) + func SafeSendChan(ch chan<- interface{}, value interface{}) (closed bool) + func SortMapByKey(mp map[string]interface{}) string + func StrFirstToLower(str string) string + func StrFirstToUpper(str string) string + func String2Bytes(s string) []byte + func Struct2Map(obj interface{}) map[string]interface + func SubString(str string, begin, length int) string + func SystemIP() string + func TodayRemainSecond() time.Duration + type Request struct + Body io.Reader + Cookies map[string]string + Headers map[string]string + Method string + PostData map[string]interface{} + Queries map[string]string + Timeout time.Duration + Url string + func NewRequest(url string) *Request + func (r *Request) Get() (*Response, error) + func (r *Request) Post() (*Response, error) + func (r *Request) Send() (*Response, error) + func (r *Request) SetBody(body io.Reader) *Request + func (r *Request) SetCookies(cookies map[string]string) *Request + func (r *Request) SetHeaders(headers map[string]string) *Request + func (r *Request) SetMethod(method string) *Request + func (r *Request) SetPostData(postData map[string]interface{}) *Request + func (r *Request) SetQueries(queries map[string]string) *Request + func (r *Request) SetTimeOut(timeout time.Duration) *Request + func (r *Request) SetUrl(url string) *Request + type Response struct + Body string + Headers map[string]string + Raw *http.Response + func NewResponse() *Response + func SendMessage(token, content string, isAtAll bool, timeout time.Duration) (*Response, error) + func (r *Response) IsOk() bool + func (r *Response) StatusCode() int