Help us shape the future of Go! Take the 2026 Go Developer Survey

wx

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppInfo

type AppInfo struct {
	NickName        string `json:"nick_name"`
	HeadImg         string `json:"head_img"`
	ServiceTypeInfo struct {
		Id   int    `json:"id"`
		Name string `json:"name"`
	} `json:"service_type_info"`
	VerifyTypeInfo struct {
		Id   int    `json:"id"`
		Name string `json:"name"`
	} `json:"verify_type_info"`
	UserName     string `json:"user_name"`
	Alias        string `json:"alias"`
	QrcodeUrl    string `json:"qrcode_url"`
	BusinessInfo struct {
		OpenPay   int `json:"open_pay"`
		OpenShake int `json:"open_shake"`
		OpenScan  int `json:"open_scan"`
		OpenCard  int `json:"open_card"`
		OpenStore int `json:"open_store"`
	} `json:"business_info"`
	Idc             int    `json:"idc"`
	PrincipalName   string `json:"principal_name"`
	Signature       string `json:"signature"`
	MiniProgramInfo struct {
		Network struct {
			RequestDomain   []string `json:"RequestDomain"`
			WsRequestDomain []string `json:"WsRequestDomain"`
			UploadDomain    []string `json:"UploadDomain"`
			DownloadDomain  []string `json:"DownloadDomain"`
			BizDomain       []string `json:"BizDomain"`
			UDPDomain       []string `json:"UDPDomain"`
		} `json:"network"`
		Categories []struct {
			First  string `json:"first"`
			Second string `json:"second"`
		} `json:"categories"`
		VisitStatus int `json:"visit_status"`
	} `json:"MiniProgramInfo"`
	BasicConfig struct {
		IsPhoneConfigured bool `json:"is_phone_configured"` // 小程序注册方式
		IsEmailConfigured bool `json:"is_email_configured"` // 小程序注册方式
	} `json:"basic_config"`
	RegisterType  int `json:"register_type"`  // 小程序注册方式
	AccountStatus int `json:"account_status"` // 帐号状态,该字段小程序也返回
	ChannelsInfo  int `json:"channels_info"`  // 视频号账号类型;如果该授权账号为视频号则返回该字段
}

type AuthorizationInfo

type AuthorizationInfo struct {
	AuthorizerAppid        string `json:"authorizer_appid"`
	AuthorizerAccessToken  string `json:"authorizer_access_token"`
	ExpiresIn              int    `json:"expires_in"`
	AuthorizerRefreshToken string `json:"authorizer_refresh_token"`
}

type Authorizer

type Authorizer interface {
	GetAuthorizerInfo(componentAccessToken, authorizerAppid string) (*GetAuthorizerInfoResult, error) // 授权账号管理 /获取授权账号详情
	GetAuthorizerOption(appId string, optionName string) (string, error)                              // 授权账号管理 /获取授权方选项信息
	SetAuthorizerOption(authorizerAccessToken string, optionName string, optionValue string) error    // 授权账号管理 /设置授权方选项信息
}

type Credential

type Credential interface {
	StartPushComponentVerifyTicket() error                                                                                     // 第三方平台调用凭证/启动票据推送服务
	CreatePreAuthCode(componentAccessToken string) (string, int, error)                                                        // 第三方平台调用凭证/获取预授权码
	GetAuthorizerAccessToken(componentAccessToken string, authorizerAppid, authorizerRefreshToken string) (string, int, error) // 第三方平台调用凭证/获取授权账号调用令牌
	QueryAuthorizationInfo(componentAccessToken, authCode string) (*AuthorizationInfo, error)                                  // 第三方平台调用凭证/获取刷新令牌
	GetComponentAccessToken(componentVerifyTicket string) (string, int, error)                                                 // 第三方平台调用凭证 /获取令牌
}

type FuncInfo

type FuncInfo struct {
	FuncscopeCategory struct {
		Id int `json:"id"`
	} `json:"funcscope_category"`
}

type GetAuthorizerAccessTokenResult

type GetAuthorizerAccessTokenResult struct {
	api.Result
	AuthorizerAccessToken  string `json:"authorizer_access_token"`
	ExpiresIn              int    `json:"expires_in"`
	AuthorizerRefreshToken string `json:"authorizer_refresh_token"`
}

type GetAuthorizerInfoResult

type GetAuthorizerInfoResult struct {
	api.Result
	Authorizer    *AppInfo `json:"authorizer_info"`
	Authorization struct {
		AppId        string      `json:"authorizer_appid"`
		RefreshToken string      `json:"authorizer_refresh_token"`
		FuncInfo     []*FuncInfo `json:"func_info"`
	} `json:"authorization_info"`
}

type GetComponentAccessTokenResult

type GetComponentAccessTokenResult struct {
	api.Result
	ComponentAccessToken string `json:"component_access_token"`
	ExpiresIn            int    `json:"expires_in"`
}

type WxAPI

type WxAPI interface {
	Authorizer
	Credential
	Wxmp
}

func New

func New(appId, appSecret string) WxAPI

type WxaCode2SessionResult

type WxaCode2SessionResult struct {
	api.Result
	SessionKey string `json:"session_key"`
	OpenId     string `json:"openid"`
	UnionId    string `json:"unionid"`
}

type Wxmp

type Wxmp interface {
	WxaCode2Session(componentAppId, componentAccessToken string, appId, code string) (*WxaCode2SessionResult, error) // 小程序登录
}

Jump to

Keyboard shortcuts

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