Versions in this module Expand all Collapse all v0 v0.0.2 Jul 8, 2024 v0.0.1 Jul 7, 2024 Changes in this version + const DELETE + const GET + const POST + const PUT + const TypeForm + const TypeFormData + const TypeHTML + const TypeJSON + const TypeMultipart + const TypeText + const TypeUrlencoded + const TypeXML + var DisableTransportSwap = false + var OneHour = time.Duration(1) * time.Hour + var TimeFormatWithZone = "2006-01-02T15:04:05-07:00" + var Types = map[string]string + var ZapLogger *zap.Logger + var ZapOnce sync.Once + func B64Decode(data string) (string, error) + func B64Encode(data []byte) string + func CeilNum[T float64 | float32 | int32](num T, precision ...int) float64 + func ContainsInt(s []int, e int) bool + func ContainsString(s []string, e string) bool + func Contains[T comparable](s []T, e T) bool + func CopyStruct(dst, src interface{}) + func Decrypt(encrypted string, key []byte) string + func DecryptBytes(encrypted string, key []byte) ([]byte, error) + func DecryptBytesIV(encrypted string, key []byte, iv []byte) ([]byte, error) + func Encrypt(idata string, key []byte) string + func EncryptBytes(data []byte, key []byte) (string, error) + func EncryptIV(data string, key []byte, iv []byte) (string, error) + func FromISOString(strTime string) time.Time + func GetDay(t *time.Time) string + func GetMapKeys(m map[string]interface{}) []string + func GetMapValues[T any](myMap map[string]T) []T + func GetMin(t *time.Time) string + func GetSec(t *time.Time) string + func GetTimeOutSeconds(durations ...int) time.Duration + func GetTimestamp(t *time.Time) string + func InitZapLogger() *zap.Logger + func JsonMerge(dst, src map[string]interface{}) map[string]interface + func LoggerError(platform, label string, input, output interface{}) + func LoggerInfo(platform, label string, input, output interface{}) + func MapMapify(i interface{}) (map[string]interface{}, bool) + func MapMerge(dst, src map[string]interface{}, depth int) map[string]interface + func MaskSensitive(source string, unMaskLen int) string + func RoundNum[T float64 | float32 | int32](num T, precision ...int) float64 + func Ternary[T comparable](condition bool, trueValue T, falseValue T) T + func TimeFormat(t time.Time, location ...string) string + func ToBool(s string, d bool) bool + func ToFen[T float64 | float32 | int32 | int](num T, precision ...int) int32 + func ToFloat(s string, precision int, f float64) float64 + func ToInt(s string, d int64) int64 + func ToYuan[T float64 | float32 | int32 | int](num T, precision ...int) float64 + func Trim[T comparable](array []T, e T) []T + func TruncateNum[T float64 | float32 | int32 | int](num T, precision ...int) float64 + func TruncateStr(s string, w string) string + func UnEscapeUnicodeBytes(bytes []byte) string + func UnEscapeUnicodeString(s string) string + type File struct + Data []byte + Fieldname string + Filename string + type LogFormat struct + Category string + Input interface{} + Label string + Latency int64 + Output interface{} + Platform string + RemoteAddr string + Timing time.Time + func (l LogFormat) ToString() string + func (log LogFormat) LoggerError() + func (log LogFormat) LoggerInfo() + type Request *http.Request + type Response *http.Response + type SuperAgent struct + BasicAuth struct{ ... } + BounceToRawString bool + Client *http.Client + Cookies []*http.Cookie + Data map[string]interface{} + Debug bool + DoNotClearSuperAgent bool + Errors []error + FileData []File + ForceType string + FormData url.Values + Header http.Header + Method string + QueryData url.Values + RawString string + Retryable superAgentRetryable + SliceData []interface{} + TargetType string + Transport *http.Transport + Url string + func NewRequest() *SuperAgent + func (s *SuperAgent) AddCookie(c *http.Cookie) *SuperAgent + func (s *SuperAgent) AddCookies(cookies []*http.Cookie) *SuperAgent + func (s *SuperAgent) AppendHeader(param string, value string) *SuperAgent + func (s *SuperAgent) ClearSuperAgent() + func (s *SuperAgent) CustomMethod(method, targetUrl string) *SuperAgent + func (s *SuperAgent) Delete(targetUrl string) *SuperAgent + func (s *SuperAgent) End(callback ...func(response Response, body string, errs []error)) (Response, string, []error) + func (s *SuperAgent) EndBytes(callback ...func(response Response, body []byte, errs []error)) (Response, []byte, []error) + func (s *SuperAgent) EndStruct(v interface{}, ...) (Response, []byte, []error) + func (s *SuperAgent) Get(targetUrl string) *SuperAgent + func (s *SuperAgent) MakeRequest() (*http.Request, error) + func (s *SuperAgent) Param(key string, value string) *SuperAgent + func (s *SuperAgent) Post(targetUrl string) *SuperAgent + func (s *SuperAgent) Proxy(proxyUrl string) *SuperAgent + func (s *SuperAgent) Put(targetUrl string) *SuperAgent + func (s *SuperAgent) Query(content interface{}) *SuperAgent + func (s *SuperAgent) RedirectPolicy(policy func(req Request, via []Request) error) *SuperAgent + func (s *SuperAgent) Send(content interface{}) *SuperAgent + func (s *SuperAgent) SendFile(file interface{}, args ...interface{}) *SuperAgent + func (s *SuperAgent) SendMap(content interface{}) *SuperAgent + func (s *SuperAgent) SendSlice(content []interface{}) *SuperAgent + func (s *SuperAgent) SendString(content string) *SuperAgent + func (s *SuperAgent) SendStruct(content interface{}) *SuperAgent + func (s *SuperAgent) Set(param string, value string) *SuperAgent + func (s *SuperAgent) SetBasicAuth(username string, password string) *SuperAgent + func (s *SuperAgent) SetDebug(enable bool) *SuperAgent + func (s *SuperAgent) SetDoNotClearSuperAgent(enable bool) *SuperAgent + func (s *SuperAgent) TLSClientConfig(config *tls.Config) *SuperAgent + func (s *SuperAgent) Timeout(timeout time.Duration) *SuperAgent + func (s *SuperAgent) Type(typeStr string) *SuperAgent