jssdk

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

README

微信JS-SDK

Documentation

Overview

微信JS-SDK.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CardSign

func CardSign(strs []string) (signature string)

JS-SDK 卡券 API 参数签名.

func WXConfigSign

func WXConfigSign(jsapiTicket, nonceStr, timestamp, url string) (signature string)

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)

type TicketServer

type TicketServer interface {
	Ticket() (ticket string, err error)                            // 请求中控服务器返回缓存的 jsapi_ticket
	RefreshTicket(currentTicket string) (ticket string, err error) // 请求中控服务器刷新 jsapi_ticket
	IIDB04E44A0E1DC11E5ADCEA4DB30FED8E1()                          // 接口标识, 没有实际意义
}

jsapi_ticket 中控服务器接口.

Jump to

Keyboard shortcuts

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