wechat_sdk_go

package module
v0.0.0-...-3744ff0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

README

测试

  • 新建文件编写以下代码
package wechat_sdk_go

const TEST_DN = "your database drive"
const TEST_SDN = "your database configure"
const TEST_APPID = "your appid"
const TEST_APPSECRET = "your appsecret"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUrlParam

func GetUrlParam(urlPath string, param map[string][]string) string

Types

type AccessToken

type AccessToken struct {
	// contains filtered or unexported fields
}

func NewComponentAccessToken

func NewComponentAccessToken(appid string, appsecret string, verifyTicket VerifyTicketInterface) *AccessToken

func (*AccessToken) GetToken

func (at *AccessToken) GetToken() (*Token, error)

func (*AccessToken) GetTokenKey

func (at *AccessToken) GetTokenKey() string

func (*AccessToken) Refresh

func (at *AccessToken) Refresh() (*Token, error)

type AccessTokenInterface

type AccessTokenInterface interface {
	GetToken() (*Token, error)
	Refresh() (*Token, error)
	GetTokenKey() string
}

type BaseRequest

type BaseRequest struct {
	DefaultConfig DefaultConfig
	AccessToken   AccessTokenInterface
}

func NewBaseRequest

func NewBaseRequest() *BaseRequest

func (*BaseRequest) Get

func (bq *BaseRequest) Get(url string, option HttpOption) (Response, error)

func (*BaseRequest) HttpPostJson

func (bq *BaseRequest) HttpPostJson(url string, option HttpOption) (Response, error)

func (*BaseRequest) Post

func (bq *BaseRequest) Post(url string, option HttpOption) (Response, error)

func (*BaseRequest) Request

func (bq *BaseRequest) Request(url string, method string, option HttpOption) (Response, error)

type DefaultConfig

type DefaultConfig struct {
	BaseUrl string
	Timeout int
}

type HttpOption

type HttpOption struct {
	Json  map[string]interface{}
	Query map[string][]string
}

type Message

type Message struct {
	BaseRequest
	Response
}

type OpenPlatform

type OpenPlatform struct {
	// contains filtered or unexported fields
}

func NewOpenPlatform

func NewOpenPlatform(appid string, appsecret string, verifyTicket VerifyTicketInterface) *OpenPlatform

func (*OpenPlatform) CreatePreAuthorizationCode

func (op *OpenPlatform) CreatePreAuthorizationCode() ([]byte, error)

func (*OpenPlatform) GetAccessToken

func (op *OpenPlatform) GetAccessToken() (*Token, error)

func (*OpenPlatform) GetAuthorizer

func (op *OpenPlatform) GetAuthorizer(appid string) ([]byte, error)

func (*OpenPlatform) GetAuthorizerOption

func (op *OpenPlatform) GetAuthorizerOption(appid string, optionName string) ([]byte, error)

func (*OpenPlatform) GetAuthorizerToken

func (op *OpenPlatform) GetAuthorizerToken(appid string, refreshToken string) ([]byte, error)

func (*OpenPlatform) HandleAuthorize

func (op *OpenPlatform) HandleAuthorize(authCode string) ([]byte, error)

func (*OpenPlatform) SetAuthorizerOption

func (op *OpenPlatform) SetAuthorizerOption(appid string, optionName string, optionValue string) ([]byte, error)

type Response

type Response struct {
	*http.Response
}

func (*Response) GetBody

func (rsp *Response) GetBody() ([]byte, error)

type StorageInterface

type StorageInterface interface {
	Get(key interface{}) map[string]interface{}
	Add(key interface{}, values interface{}) bool
	Save(key interface{}, values interface{}) bool
	Delete(key interface{}) bool
}

type Token

type Token struct {
	AccessToken string
	ExpiresIn   int64
}

type VerifyTicketInterface

type VerifyTicketInterface interface {
	Get(appid string) string
}

Jump to

Keyboard shortcuts

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