utils

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2022 License: MulanPSL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IPUnknown represents unknown ip
	// 32 * 0
	IPUnknown = "00000000000000000000000000000000"
)

Variables

This section is empty.

Functions

func GenLogID

func GenLogID() string

GenLogID return a new logID

func Hmac

func Hmac(s string, appSecret string) string

Hmac 计算hmac

func Marshal

func Marshal(o interface{}) string

Marshal 序列化参数

func MarshalNoErr

func MarshalNoErr(object interface{}) string

func Md5

func Md5(s string) string

func Sign

func Sign(appKey, appSecret, method string, timestamp int64, paramJson string) string

Sign 计算签名

func SpiSign

func SpiSign(appKey, appSecret, timestamp string, paramJson interface{}, signMethod string) string

Types

type LogID

type LogID struct{}

LogID represents a logID generator

func NewLogID

func NewLogID() LogID

NewLogID create a new LogID instance

func (LogID) GenLogID

func (l LogID) GenLogID() string

GenLogID return a new logID string

Jump to

Keyboard shortcuts

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