wechat

package
v0.0.0-...-3d0adf2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : config.go # Created : 2019/1/7 19:56 # Last Modified : 2019/1/7 19:56 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : request.go # Created : 2019/1/7 20:14 # Last Modified : 2019/1/7 20:14 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : response.go # Created : 2019/1/8 10:32 # Last Modified : 2019/1/8 10:32 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : send.go # Created : 2019/1/7 14:34 # Last Modified : 2019/1/7 14:34 # Describe : # # ====================================================

Index

Constants

View Source
const (
	WeiXinAccessToken = "weixin_access_token"
)

Variables

View Source
var (
	ErrTokenOverdue = errors.New("weixin token is overdued")
)

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(cfg Config, cli cache.Cache) *Client

func (*Client) Send

func (c *Client) Send(msg send.Message, do send.DoRes) error

type Config

type Config struct {
	APPId     string
	APPSecret string
}

type Request

type Request struct {
	ToUser     string `json:"touser"`
	TemplateId string `json:"template_id"`
	URL        string `json:"url"`
	Data       string `json:"data"`
}

func NewRequest

func NewRequest(to, templateId, url string, data []byte) *Request

func (*Request) Content

func (r *Request) Content() []byte

func (*Request) To

func (r *Request) To() string

type Response

type Response struct {
	ErrCode     int    `json:"errcode"`
	ErrMsg      string `json:"errmsg"`
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
}

Response 微信接口返回值

Jump to

Keyboard shortcuts

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