Documentation ¶
Index ¶
- Constants
- func GetRandString(length int) string
- func GetRandStringWithCharset(length int, charset string) string
- type AccessToken
- type CDATA
- type CryptError
- type DingTalkCrypto
- type LarkCrypto
- type ProtocolProcessor
- type ProtocolType
- type WXBizMsg4Recv
- type WXBizMsg4Send
- type WXBizMsgCrypt
- func (self *WXBizMsgCrypt) DecryptMsg(msg_signature, timestamp, nonce string, post_data []byte) ([]byte, string, *CryptError)
- func (self *WXBizMsgCrypt) EncryptMsg(reply_msg, timestamp, nonce string) ([]byte, *CryptError)
- func (self *WXBizMsgCrypt) ParsePlainText(plaintext []byte) ([]byte, uint32, []byte, []byte, *CryptError)
- func (self *WXBizMsgCrypt) VerifyURL(msg_signature, timestamp, nonce, echostr string) ([]byte, string, *CryptError)
- type XmlProcessor
Constants ¶
View Source
const ( ValidateSignatureError int = -40001 ParseXmlError int = -40002 ComputeSignatureError int = -40003 IllegalAesKey int = -40004 ValidateCorpidError int = -40005 EncryptAESError int = -40006 DecryptAESError int = -40007 IllegalBuffer int = -40008 EncodeBase64Error int = -40009 DecodeBase64Error int = -40010 GenXmlError int = -40010 ParseJsonError int = -40012 GenJsonError int = -40013 IllegalProtocolType int = -40014 )
View Source
const ContentType = "application/json;charset=utf-8"
Variables ¶
This section is empty.
Functions ¶
func GetRandStringWithCharset ¶
GetRandStringWithCharset 获取指定字符集 下 指定长度的随机字符串
Types ¶
type AccessToken ¶
type AccessToken struct { Id string Cache cachego.Cache GetRefreshRequestFunc getRefreshRequestFunc }
func (AccessToken) ApplyAccessToken ¶
func (a AccessToken) ApplyAccessToken(url url.Values) url.Values
func (AccessToken) GetAccessToken ¶
func (a AccessToken) GetAccessToken() (token string)
func (AccessToken) SetLarkAccessToken ¶
func (a AccessToken) SetLarkAccessToken(header http.Header) http.Header
type CryptError ¶
func NewCryptError ¶
func NewCryptError(err_code int, err_msg string) *CryptError
type DingTalkCrypto ¶
type DingTalkCrypto struct { Token string EncodingAESKey string SuiteKey string BKey []byte Block cipher.Block }
func NewDingTalkCrypto ¶
func NewDingTalkCrypto(token, encodingAESKey, suiteKey string) *DingTalkCrypto
func (*DingTalkCrypto) GetDecryptMsg ¶
func (c *DingTalkCrypto) GetDecryptMsg(signature, timestamp, nonce, secretMsg string) (string, error)
func (*DingTalkCrypto) GetEncryptMsg ¶
func (c *DingTalkCrypto) GetEncryptMsg(msg, timestamp, nonce string) (string, string, error)
type LarkCrypto ¶
func NewLarkCrypto ¶
func NewLarkCrypto() *LarkCrypto
func (*LarkCrypto) GetDecryptMsg ¶
func (self *LarkCrypto) GetDecryptMsg(signature, timestamp, nonce string, msg []byte) (string, error)
type ProtocolProcessor ¶
type ProtocolProcessor interface {
// contains filtered or unexported methods
}
type WXBizMsg4Recv ¶
type WXBizMsg4Send ¶
type WXBizMsg4Send struct { XMLName xml.Name `xml:"xml"` Encrypt CDATA `xml:"Encrypt"` Signature CDATA `xml:"MsgSignature"` Timestamp string `xml:"TimeStamp"` Nonce CDATA `xml:"Nonce"` }
func NewWXBizMsg4Send ¶
func NewWXBizMsg4Send(encrypt, signature, timestamp, nonce string) *WXBizMsg4Send
type WXBizMsgCrypt ¶
type WXBizMsgCrypt struct {
// contains filtered or unexported fields
}
func NewWXBizMsgCrypt ¶
func NewWXBizMsgCrypt(appId, token, aesKey string) *WXBizMsgCrypt
func (*WXBizMsgCrypt) DecryptMsg ¶
func (self *WXBizMsgCrypt) DecryptMsg(msg_signature, timestamp, nonce string, post_data []byte) ([]byte, string, *CryptError)
func (*WXBizMsgCrypt) EncryptMsg ¶
func (self *WXBizMsgCrypt) EncryptMsg(reply_msg, timestamp, nonce string) ([]byte, *CryptError)
func (*WXBizMsgCrypt) ParsePlainText ¶
func (self *WXBizMsgCrypt) ParsePlainText(plaintext []byte) ([]byte, uint32, []byte, []byte, *CryptError)
func (*WXBizMsgCrypt) VerifyURL ¶
func (self *WXBizMsgCrypt) VerifyURL(msg_signature, timestamp, nonce, echostr string) ([]byte, string, *CryptError)
type XmlProcessor ¶
type XmlProcessor struct { }
Click to show internal directories.
Click to hide internal directories.