util

package
v0.0.0-...-272df7f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DateLayout = "2006-01-02"

Variables

Functions

func AnyNum2Float64

func AnyNum2Float64(in interface{}) (out float64, err error)

func DecodeSinaData

func DecodeSinaData(rawData string) (interface{}, error)

func EasyGet

func EasyGet(target string, reqParam map[string]interface{}, trim *TrimBound, receiver interface{}, header map[string]string) error

func EasyPost

func EasyPost(target string, payload map[string]interface{}, header map[string]string, receiver interface{}) error

func GetPECrawlToken

func GetPECrawlToken() (string, error)

func ParseBodyWithTrimAsJSON

func ParseBodyWithTrimAsJSON(body io.ReadCloser, trim *TrimBound, result interface{}) error

func RewriteStructJSON

func RewriteStructJSON(input interface{}) (result interface{}, err error)

func String

func String(value interface{}) string

func UrlParamConstruct

func UrlParamConstruct(target string, param map[string]interface{}) string

Types

type CustomDate

type CustomDate string

func (*CustomDate) UnmarshalJSON

func (c *CustomDate) UnmarshalJSON(b []byte) error

type TolerantFloat

type TolerantFloat float64

func (*TolerantFloat) UnmarshalJSON

func (t *TolerantFloat) UnmarshalJSON(b []byte) error

type TrimBound

type TrimBound struct {
	Pre string
	Sur string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL