entity

package
v0.0.0-...-4009942 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: MIT Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	URL     string `json:"-"`     // API 地址
	MerchID string `json:"mchid"` // 商户号
	Sign    string `json:"sign"`  // 数据签名
	Data    string `json:"-"`     // 数据
}

Request 请求结构

func NewRequest

func NewRequest(u, merchID, data string) *Request

NewRequest 创建请求

func (*Request) JSON

func (r *Request) JSON() (string, error)

JSON 组合请求对象

func (*Request) Signature

func (r *Request) Signature(key string) error

Signature 计算签名

type Response

type Response struct {
	ReturnCode int    `json:"return_code"` // 1:请求成功,0:请求失败
	ReturnMsg  string `json:"return_msg"`  // 返回消息
	Sign       string `json:"sign"`        // 数据签名
	Data       string `json:"-"`           // 数据
}

Response 响应结构

func ParseResponse

func ParseResponse(data string) *Response

ParseResponse 解析响应

func (*Response) Get

func (r *Response) Get(key string) gjson.Result

Get 获取响应内容

Jump to

Keyboard shortcuts

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