Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/chanxuehong/wechat
/ functions
Functions
669 in github.com/chanxuehong/wechat
⨍
Functions
669
◇
Types & classes
332
↓ 119 callers
Method
PostJSON
PostJSON 用 encoding/json 把 request marshal 为 JSON, HTTP POST 到微信服务器, 然后将微信服务器返回的 JSON 用 encoding/json 解析到 response. NOTE: 1. 一般不需要调用这个方法, 请直接调用高层次的
mp/core/client.go:114
↓ 81 callers
Method
WriteString
(s string)
mp/core/context.go:128
↓ 49 callers
Method
ServeError
ServeError 处理回调的错误, 比如 xml 解码出错, return_code != "SUCCESS", result_code != "SUCCESS", ...
mch/core/error_handler.go:11
↓ 26 callers
Method
Get
Get 返回 Context 中 key 对应的 value, 如果 key 存在的返回 (value, true), 否则返回 (nil, false).
mp/core/context.go:98
↓ 24 callers
Method
Error
()
oauth2/error.go:16
↓ 23 callers
Method
Error
()
mch/core/error.go:24
↓ 22 callers
Method
GetJSON
GetJSON HTTP GET 微信资源, 然后将微信服务器返回的 JSON 用 encoding/json 解析到 response. NOTE: 1. 一般不需要调用这个方法, 请直接调用高层次的封装函数; 2. 最终的 URL == incompleteURL + access_to
mp/core/client.go:47
↓ 19 callers
Function
APIBaseURL
()
mch/core/api_base_url.go:3
↓ 18 callers
Method
PostXML
PostXML 是微信支付通用请求方法. err == nil 表示 (return_code == "SUCCESS" && result_code == "SUCCESS").
mch/core/client.go:90
↓ 15 callers
Function
SecureCompareString
(given, actual string)
internal/util/cmp-string.go:5
↓ 14 callers
Method
Error
()
mp/core/error.go:29
↓ 14 callers
Function
Int
Int is a helper routine that allocates a new int value to store v and returns a pointer to it.
internal/util/helper.go:11
↓ 14 callers
Method
check
()
mp/core/started_checker.go:26
↓ 10 callers
Function
DecodeJSONHttpResponse
(r io.Reader, v interface{})
internal/debug/api/release.go:17
↓ 10 callers
Function
Sign2
Sign2 微信支付签名. params: 待签名的参数集合 apiKey: api密钥 h: hash.Hash, 如果为 nil 则默认用 md5.New(), 特别注意 h 必须是 initial state.
mch/core/sign.go:30
↓ 10 callers
Function
WXVersion
获取微信客户端的版本. userAgent: 微信内置浏览器的 User-Agent; x, y, z, w: 如果微信版本为 5.3.1.2 则有 x==5, y==3, z==1, w==2 err: 错误信息
util/wxver.go:15
↓ 10 callers
Function
combineHandlerChain
(middlewares, handlers HandlerChain)
mp/core/handler.go:342
↓ 9 callers
Method
PostMultipartForm
PostMultipartForm 通用上传接口. --BOUNDARY Content-Disposition: form-data; name="FIELDNAME"; filename="FILENAME" Content-Type: application/octet-stream
mp/core/client_upload.go:45
↓ 8 callers
Function
DebugPrintGetRequest
(url string)
internal/debug/api/release.go:11
↓ 8 callers
Function
ToLower
ToLower 返回字符串对应的小写版本. 如果确定 s 是[a-zA-Z0-9_-] 的组合, 那么可以用这个函数, 否则请用 strings.ToLower!
internal/util/to_lower.go:6
↓ 7 callers
Function
NonceStr
()
util/nonce_str.go:9
↓ 7 callers
Function
Sign
Sign 微信公众号 url 签名.
internal/util/sign.go:11
↓ 5 callers
Function
DebugPrintError
(errcode int64, errmsg string, token string)
internal/debug/api/retry/release.go:6
↓ 5 callers
Function
DebugPrintFallthrough
(token string)
internal/debug/api/retry/release.go:10
↓ 5 callers
Function
DebugPrintNewToken
(token string)
internal/debug/api/retry/release.go:8
↓ 5 callers
Function
Int64
Int64 is a helper routine that allocates a new int64 value to store v and returns a pointer to it.
internal/util/helper.go:23
↓ 5 callers
Function
MsgSign
MsgSign 微信公众号/企业号 消息体签名.
internal/util/sign.go:25
↓ 5 callers
Method
ServeMsg
(*Context)
mch/core/handler.go:4
↓ 5 callers
Method
Token
()
mp/core/access_token_server.go:20
↓ 5 callers
Method
getToken
()
mp/core/server.go:102
↓ 4 callers
Method
ApiKey
()
mch/core/server.go:94
↓ 4 callers
Method
RefreshToken
RefreshToken 刷新 access_token. NOTE: 1. refreshToken 可以为空. 2. 返回的 token == clt.Token
oauth2/api.go:51
↓ 4 callers
Function
Sign
Sign 微信支付签名. params: 待签名的参数集合 apiKey: api密钥 fn: func() hash.Hash, 如果为 nil 则默认用 md5.New
mch/core/sign.go:18
↓ 4 callers
Function
uploadFromReader
(clt *core.Client, mediaType, filename string, reader io.Reader)
mp/media/upload.go:73
↓ 4 callers
Method
useForEvent
(middlewares []Handler)
mp/core/handler.go:207
↓ 4 callers
Method
useForMsg
(middlewares []Handler)
mp/core/handler.go:168
↓ 3 callers
Function
AESDecryptMsg
ciphertext = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + appId]
internal/util/aes_crypto.go:63
↓ 3 callers
Method
ApiKey
()
mch/core/client.go:36
↓ 3 callers
Function
DecodeXMLToMap
DecodeXMLToMap decodes xml reading from io.Reader and returns the first-level sub-node key-value set, if the first-level sub-node contains child nodes
internal/util/xml-map.go:13
↓ 3 callers
Function
EncodeXMLFromMap
EncodeXMLFromMap encodes map[string]string to io.Writer with xml format. NOTE: This function requires the rootname argument and the keys of m (type ma
internal/util/xml-map.go:61
↓ 3 callers
Function
FormatTime
FormatTime 将参数 t 格式化成北京时间 yyyyMMddHHmmss.
mch/core/time.go:10
↓ 3 callers
Function
MsgSign2
(token, timestamp, nonce, encryptedMsg string)
internal/util/sign_test.go:113
↓ 3 callers
Method
Set
Context:kvs ========================================================================================================= Set 存储 key-value pair 到 Context
mp/core/context.go:90
↓ 3 callers
Method
Token
()
oauth2/oauth2.go:13
↓ 3 callers
Function
checkResponse
checkResponse 检查 response 参数是否满足特定的结构要求, 如果不满足要求则会 panic, 否则返回相应的 reflect.Value.
mp/core/client.go:185
↓ 3 callers
Method
getAESKey
()
mp/core/server.go:146
↓ 3 callers
Method
removeLastToken
(lastToken string)
mp/core/server.go:131
↓ 3 callers
Function
upload
=====================================================================================================================
mp/media/upload.go:63
↓ 3 callers
Function
xmlUnmarshal
<xml> <ToUserName><![CDATA[gh_b1eb3f8bd6c6]]></ToUserName> <Encrypt><![CDATA[DlCGq+lWQuyjNNK+vDaO0zUltpdUW3u4V00WCzsdNzmZGEhrU7TPxG52viOKCWYPwTMbCz
mp/core/server.go:552
↓ 2 callers
Function
AESEncryptMsg
ciphertext = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + appId]
internal/util/aes_crypto.go:26
↓ 2 callers
Function
BatchGet
获取素材列表. materialType: 素材的类型, 图片(image), 视频(video), 语音 (voice) offset: 从全部素材的该偏移位置开始返回, 0表示从第一个素材 count: 返回素材的数量, 取值在1到20之间
mp/material/material.go:74
↓ 2 callers
Function
BatchGetNews
获取图文素材列表. offset: 从全部素材的该偏移位置开始返回, 0表示从第一个素材 count: 返回素材的数量, 取值在1到20之间
mp/material/news.go:111
↓ 2 callers
Function
Bool
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
util/helper.go:5
↓ 2 callers
Function
DebugPrintPlainRequestMessage
(msg []byte)
internal/debug/callback/release.go:14
↓ 2 callers
Function
DebugPrintPostJSONRequest
(url string, body []byte)
internal/debug/api/release.go:13
↓ 2 callers
Function
DeviceList
批量查询设备统计数据接口
mp/shakearound/statistics/devicelist.go:22
↓ 2 callers
Method
ExchangeTokenURL
(code string)
oauth2/oauth2.go:8
↓ 2 callers
Function
Get
Get 获取客服聊天记录
mp/dkf/record/record.go:27
↓ 2 callers
Method
Get
Get 返回 Context 中 key 对应的 value, 如果 key 存在的返回 (value, true), 否则返回 (nil, false).
mch/core/context.go:87
↓ 2 callers
Function
GetSubscribeEvent
(msg *core.MixedMsg)
mp/message/callback/request/event.go:29
↓ 2 callers
Function
Int64
Int64 is a helper routine that allocates a new int64 value to store v and returns a pointer to it.
util/helper.go:23
↓ 2 callers
Function
List
List 查询门店列表. begin: 开始位置,0 即为从第一条开始查询 limit: 返回数据条数,最大允许50,默认为20
mp/poi/list.go:19
↓ 2 callers
Function
List
List 获取用户列表. NOTE: 每次最多能获取 10000 个用户, 可以多次指定 nextOpenId 来获取以满足需求, 如果 nextOpenId == "" 则表示从头获取
mp/user/list.go:25
↓ 2 callers
Function
List
获取WiFi门店列表. pageIndex: 分页下标,默认从1开始 pageSize: 每页的个数,默认10个,最大20个
mp/bizwifi/shop/list.go:30
↓ 2 callers
Function
List
查询设备.
mp/bizwifi/device/list.go:46
↓ 2 callers
Method
Next
Next 中断当前 handler 程序逻辑执行其后续的 handlers, 一般在 middleware 中调用.
mp/core/context.go:58
↓ 2 callers
Function
PageList
批量查询设备统计数据接口
mp/shakearound/statistics/pagelist.go:22
↓ 2 callers
Function
ParseTime
ParseTime 将北京时间 yyyyMMddHHmmss 字符串解析到 time.Time.
mch/core/time.go:15
↓ 2 callers
Method
RefreshToken
请求中控服务器返回缓存的 access_token
mp/core/access_token_server.go:21
↓ 2 callers
Method
RefreshTokenURL
通过code换取access_token的地址
oauth2/oauth2.go:9
↓ 2 callers
Function
Search
查询页面列表.
mp/shakearound/page/search.go:48
↓ 2 callers
Function
Search
查询设备与页面的关联关系.
mp/shakearound/relation/search.go:56
↓ 2 callers
Function
Search
查询设备列表.
mp/shakearound/device/search.go:64
↓ 2 callers
Method
SessionCodeUrl
(code string)
mp/oauth2/endpoint.go:36
↓ 2 callers
Function
WXConfigSign
JS-SDK wx.config 的参数签名.
mp/jssdk/sign.go:12
↓ 2 callers
Function
WXConfigSign2
(jsapiTicket, nonceStr, timestamp, url string)
mp/jssdk/sign_test.go:94
↓ 2 callers
Function
WXConfigSign3
(jsapiTicket, nonceStr, timestamp, url string)
mp/jssdk/sign_test.go:122
↓ 2 callers
Function
abs
(x time.Duration)
mp/jssdk/ticket_server.go:108
↓ 2 callers
Function
addFromReader
(clt *core.Client, filename string, reader io.Reader, _type string)
mp/shakearound/material/add.go:40
↓ 2 callers
Function
downloadBillToWriter
下载对账单到 io.Writer.
mch/pay/downloadbill.go:75
↓ 2 callers
Function
getSession
(session *Session, url string, httpClient *http.Client)
mp/oauth2/session.go:54
↓ 2 callers
Function
newTLSHttpClient
(tlsConfig *tls.Config)
mch/core/ssl_http_client_go1.8.go:37
↓ 2 callers
Function
newTLSHttpClient
(tlsConfig *tls.Config)
mch/core/ssl_http_client_go1.7.go:37
↓ 2 callers
Function
newTLSHttpClient
(tlsConfig *tls.Config)
mch/core/ssl_http_client_go1.6.go:37
↓ 2 callers
Method
putToken
(tk *Token)
oauth2/client.go:51
↓ 2 callers
Function
trimLeft
(s []byte)
mch/pay/downloadbill.go:169
↓ 2 callers
Method
updateTicket
updateTicket 从微信服务器获取新的 jsapi_ticket 并存入缓存, 同时返回该 jsapi_ticket.
mp/jssdk/ticket_server.go:121
↓ 2 callers
Method
updateTicket
updateTicket 从微信服务器获取新的卡劵 api_ticket 并存入缓存, 同时返回该卡劵 api_ticket.
mp/jssdk/card_ticket_server.go:121
↓ 2 callers
Method
updateToken
(tk *Token, url string)
oauth2/api.go:77
↓ 2 callers
Method
updateToken
updateToken 从微信服务器获取新的 access_token 并存入缓存, 同时返回该 access_token.
mp/core/access_token_server.go:130
↓ 1 callers
Function
AESDecryptData
(cipherText []byte, aesKey []byte, iv []byte)
internal/util/aes_crypto.go:119
↓ 1 callers
Method
AppId
()
mch/core/server.go:88
↓ 1 callers
Method
AppendHandler
(handlers ...Handler)
mch/core/handler.go:37
↓ 1 callers
Function
AuthCodeToOpenId
AuthCodeToOpenId 授权码查询openid.
mch/tools/authcodetoopenid.go:9
↓ 1 callers
Function
CardSign
JS-SDK 卡券 API 参数签名.
mp/jssdk/sign.go:37
↓ 1 callers
Function
ClassicalSign
传统的签名代码, Sign 是优化后的代码, 要提高 30% 的速度
mch/core/sign_test.go:111
↓ 1 callers
Function
CloseOrder
CloseOrder 关闭订单.
mch/pay/closeorder.go:9
↓ 1 callers
Function
DebugPrintPostMultipartRequest
(url string, body []byte)
internal/debug/api/release.go:15
↓ 1 callers
Function
DebugPrintPostXMLRequest
(url string, body []byte)
internal/debug/mch/api/release.go:14
↓ 1 callers
Function
DebugPrintRequest
(r *http.Request)
internal/debug/mch/callback/release.go:13
next →
1–100 of 669, ranked by callers