service

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// 重试次数
	Retries int = 3
	// 请求方法
	GET    string = "GET"
	POST   string = "POST"
	DELETE string = "DELETE"
	PUT    string = "PUT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	// get请求
	Get(url string, params *map[string]interface{}, resp interface{}) error
	// post请求
	Post(url string, data *map[string]interface{}, resp interface{}) error
	// get请求,请求文件
	GetFile(url string, params *map[string]interface{}) ([]byte, error)
	// postFile请求
	PostFile(url string, data *map[string]interface{}) ([]byte, error)
	// 执行请求
	//Execute(method string, uri string, data *map[string]interface{}, resp interface{}) error
	// 获取access_token
	GetAccessToken() (string, error)
	// 验证消息的确来自微信服务器.
	CheckSignature(timestamp string, nonce string, signature string) bool
	// 获取Config配置
	GetConfig() *config.Config
}

type WxaService

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

func NewInMemory

func NewInMemory(wxaConfig *config.WxaInMemoryConfig) *WxaService

基于内存管理 access_token

func NewInRedis

func NewInRedis(wxaConfig *config.WxaInRedisConfig) *WxaService

基于Redis管理 access_token

func (*WxaService) CheckSignature

func (wxa *WxaService) CheckSignature(timestamp string, nonce string, signature string) bool

func (*WxaService) Get

func (wxa *WxaService) Get(url string, params *map[string]interface{}, resp interface{}) error

func (*WxaService) GetAccessToken

func (wxa *WxaService) GetAccessToken() (string, error)

获取access_token

func (*WxaService) GetConfig

func (wxa *WxaService) GetConfig() (cfg *config.Config)

func (*WxaService) GetFile

func (wxa *WxaService) GetFile(url string, params *map[string]interface{}) ([]byte, error)

func (*WxaService) GetKfService

func (wxa *WxaService) GetKfService() *wxaKfService

func (*WxaService) GetQrCodeService

func (wxa *WxaService) GetQrCodeService() *wxaQrCodeService

func (*WxaService) GetSubscribeMsgService

func (wxa *WxaService) GetSubscribeMsgService() *wxaSubscribeMsgService

func (*WxaService) GetUniformMessageService

func (wxa *WxaService) GetUniformMessageService() *wxaUniformMessageService

func (*WxaService) GetUserService

func (wxa *WxaService) GetUserService() *wxaUserService

func (*WxaService) Post

func (wxa *WxaService) Post(url string, data *map[string]interface{}, resp interface{}) error

func (*WxaService) PostFile

func (wxa *WxaService) PostFile(url string, data *map[string]interface{}) ([]byte, error)

Jump to

Keyboard shortcuts

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