wxbiz

package
v0.0.0-...-250a219 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CDATA

type CDATA struct {
	Value string `xml:",cdata"`
}

type Msg

type Msg struct {
	From    MsgFrom
	MsgType string
	MsgId   string
	Text    struct {
		Content string
	}
}

type MsgFrom

type MsgFrom struct {
	UserId string
	Name   string
	Alias  string
}

type MsgRecv

type MsgRecv struct {
	Tousername string `xml:"ToUserName"`
	Encrypt    string `xml:"Encrypt"`
	Agentid    string `xml:"AgentID"`
}

type MsgReply

type MsgReply struct {
	XMLName xml.Name `xml:"xml"`
	MsgType string
	Text    struct {
		Content CDATA
	}
}

type MsgSend

type MsgSend struct {
	XMLName   xml.Name `xml:"xml"`
	Encrypt   CDATA    `xml:"Encrypt"`
	Signature CDATA    `xml:"MsgSignature"`
	Nonce     CDATA    `xml:"Nonce"`
	Timestamp string   `xml:"TimeStamp"`
}

type PlainMsg

type PlainMsg struct {
	Random    string
	MsgLen    uint32
	Msg       string
	ReceiveID string
}

type Wxbiz

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

func New

func New(aeskey, token string) (*Wxbiz, error)

func (*Wxbiz) AesDecrypt

func (s *Wxbiz) AesDecrypt(base64Text string) ([]byte, error)

func (*Wxbiz) AesEncrypt

func (s *Wxbiz) AesEncrypt(data []byte) (string, error)

func (*Wxbiz) Decode

func (s *Wxbiz) Decode(sign, ts, nonce, data string) (string, error)

func (*Wxbiz) Encode

func (s *Wxbiz) Encode(ts, nonce, data string) (string, error)

func (*Wxbiz) PackMsg

func (s *Wxbiz) PackMsg(msg *MsgReply, ts, nonce string) (*MsgSend, []byte, error)

func (*Wxbiz) ParsePlainText

func (s *Wxbiz) ParsePlainText(plaintext []byte) (*PlainMsg, error)

func (*Wxbiz) ReplyText

func (s *Wxbiz) ReplyText(msg *Msg, content string, mention []string) *MsgReply

func (*Wxbiz) UnpackMsg

func (s *Wxbiz) UnpackMsg(sign, ts, nonce string, data []byte) (*Msg, error)

func (*Wxbiz) VerifyURL

func (s *Wxbiz) VerifyURL(sign, ts, nonce, echostr string) (string, error)

Jump to

Keyboard shortcuts

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