util

package
v0.0.0-...-0f65a33 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: BSD-2-Clause Imports: 22 Imported by: 5

Documentation

Index

Constants

View Source
const (
	TimeFormatDate_       = "2006-01-02"
	TimeFormatDate        = "20060102"
	TimeFormatTime        = "15:04:05"
	TimeFormatDateTime    = "2006-01-02 15:04:05"
	TimeLongFormat        = "20060102150405"
	TimeFormatUTCDateTime = "2006-01-02T15:04:05Z"
)

Variables

View Source
var BeijingLocation = time.FixedZone("Asia/Shanghai", 8*60*60)

Functions

func BlockHandler

func BlockHandler() echo.HandlerFunc

func Callers

func Callers(skip int) []uintptr

这里的 skip 一般 <= 3

func ChangeErr2Grpc

func ChangeErr2Grpc(err error) error

func CmdlineHandler

func CmdlineHandler() echo.HandlerFunc

func EncodeXMLFromMap

func EncodeXMLFromMap(w io.Writer, m map[string]string, rootname string) (err error)

func EncodeXmlToMap

func EncodeXmlToMap(xmlStr string) map[string]string

*

  • 根据xml字符串解析成map

func GenWxSign

func GenWxSign(data url.Values, key string) string

微信的md5签名

func GenerateSpanID

func GenerateSpanID(addr string) string

func GetClientIP

func GetClientIP(c echo.Context) string

func GetLocalIP

func GetLocalIP() net.IP

func GoroutineHandler

func GoroutineHandler() echo.HandlerFunc

func HeapHandler

func HeapHandler() echo.HandlerFunc

func IndexHandler

func IndexHandler() echo.HandlerFunc

func Ip2Long

func Ip2Long(ip string) (uint32, error)

func Md5

func Md5(str string) string

func MutexHandler

func MutexHandler() echo.HandlerFunc

func ProfileHandler

func ProfileHandler() echo.HandlerFunc

func RemoveRepByLoop

func RemoveRepByLoop(slc []int) []int

func StackInfo

func StackInfo(stack []uintptr) string

打印指定 skip 层的栈信息

func StackInfoAll

func StackInfoAll() string

打印所有的栈信息

func StringJoin

func StringJoin(a []int, split string) string

func SymbolHandler

func SymbolHandler() echo.HandlerFunc

func ThreadCreateHandler

func ThreadCreateHandler() echo.HandlerFunc

func TimeGetBirthday

func TimeGetBirthday(idCard string, separator string) (birthday string, err error)

*

  • 从身份证号中获取生日
  • @params idCard 身份证号
  • @params separator 生日分隔符
  • @return 生日
  • @return 错误

func TraceHandler

func TraceHandler() echo.HandlerFunc

func Wrap

func Wrap(e *echo.Echo)

func WrapGroup

func WrapGroup(prefix string, g *echo.Group)

Types

This section is empty.

Jump to

Keyboard shortcuts

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