Documentation ¶
Overview ¶
微信JS-SDK.
Index ¶
- func CardSign(strs []string) (signature string)
- func UpdateTicket(ctl *core.Client) (ticket string, expiresIn int64, err error)
- func WXConfigSign(jsapiTicket, nonceStr, timestamp, url string) (signature string)
- type CardTicketServer
- type DefaultCardTicketServer
- type DefaultTicketServer
- type TicketServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdateTicket ¶
updateTicket 从微信服务器获取新的 jsapi_ticket 并存入缓存, 同时返回该 jsapi_ticket.
func WXConfigSign ¶
JS-SDK wx.config 的参数签名.
Types ¶
type CardTicketServer ¶
type CardTicketServer interface { Ticket() (ticket string, err error) // 请求中控服务器返回缓存的卡劵 api_ticket RefreshTicket(currentTicket string) (ticket string, err error) // 请求中控服务器刷新卡劵 api_ticket IIDB9BDD0A1E1DC11E5844AA4DB30FED8E1() // 接口标识, 没有实际意义 }
卡劵 api_ticket 中控服务器接口.
type DefaultCardTicketServer ¶
type DefaultCardTicketServer struct {
// contains filtered or unexported fields
}
DefaultCardTicketServer 实现了 CardTicketServer 接口.
NOTE: 1. 用于单进程环境. 2. 因为 DefaultCardTicketServer 同时也是一个简单的中控服务器, 而不是仅仅实现 CardTicketServer 接口, 所以整个系统只能存在一个 DefaultCardTicketServer 实例!
func NewDefaultCardTicketServer ¶
func NewDefaultCardTicketServer(clt *core.Client) (srv *DefaultCardTicketServer)
NewDefaultCardTicketServer 创建一个新的 DefaultCardTicketServer.
func (*DefaultCardTicketServer) IIDB9BDD0A1E1DC11E5844AA4DB30FED8E1 ¶
func (srv *DefaultCardTicketServer) IIDB9BDD0A1E1DC11E5844AA4DB30FED8E1()
func (*DefaultCardTicketServer) RefreshTicket ¶
func (srv *DefaultCardTicketServer) RefreshTicket(currentTicket string) (ticket string, err error)
func (*DefaultCardTicketServer) Ticket ¶
func (srv *DefaultCardTicketServer) Ticket() (ticket string, err error)
type DefaultTicketServer ¶
type DefaultTicketServer struct {
// contains filtered or unexported fields
}
DefaultTicketServer 实现了 TicketServer 接口.
NOTE: 1. 用于单进程环境. 2. 因为 DefaultTicketServer 同时也是一个简单的中控服务器, 而不是仅仅实现 TicketServer 接口, 所以整个系统只能存在一个 DefaultTicketServer 实例!
func NewDefaultTicketServer ¶
func NewDefaultTicketServer(clt *core.Client) (srv *DefaultTicketServer)
NewDefaultTicketServer 创建一个新的 DefaultTicketServer.
func (*DefaultTicketServer) IIDB04E44A0E1DC11E5ADCEA4DB30FED8E1 ¶
func (srv *DefaultTicketServer) IIDB04E44A0E1DC11E5ADCEA4DB30FED8E1()
func (*DefaultTicketServer) RefreshTicket ¶
func (srv *DefaultTicketServer) RefreshTicket(currentTicket string) (ticket string, err error)
func (*DefaultTicketServer) Ticket ¶
func (srv *DefaultTicketServer) Ticket() (ticket string, err error)
Click to show internal directories.
Click to hide internal directories.