Documentation ¶
Index ¶
- Constants
- type CDATAText
- type Cache
- type CacheConfig
- type CacheDefault
- type CipherRequestHttpBody
- type CipherResponseHttpBody
- type ClientConfig
- type Endpoint
- func (self *Endpoint) ApiAuthorizerToken(componentToken string) string
- func (self *Endpoint) ApiQueryAuth(componentToken string) string
- func (self *Endpoint) CommitCode(componentToken string) string
- func (self *Endpoint) ComponentAccessTokenUrl() string
- func (self *Endpoint) CustomService(componentToken string) string
- func (self *Endpoint) FastRegisterWeapp(componentToken string) string
- func (self *Endpoint) ModifyDomain(componentToken string) string
- func (self *Endpoint) PreAuthCodoUrl(componentToken string) string
- func (self *Endpoint) Release(componentToken string) string
- func (self *Endpoint) SetBaseUrl(base string)
- type EventHeaderMessage
- type EventMessage
- type HttpClient
- type IClient
- type Message
- type MessageDecoder
- type MessageEncoder
- type MessageHeader
- type NotifyHeaderMessage
- type NotifyMessage
- type Server
- type Text
Constants ¶
View Source
const ( EventComponentVerifyTicket = "component_verify_ticket" EventAuthorized = "authorized" EventUpdateAuthorized = "updateauthorized" EventNotifyThirdFasteregister = "notify_third_fasteregister" )
View Source
const (
AutoTestMpId = "wxd101a85aa106f53e"
)
View Source
const (
ComponentTicketCacheKeyPrefix = "CACHE_TICKET@@"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Set(key string, val interface{}) error SetEx(key string, val interface{}, expires int64) error Get(key string) ([]byte, error) Exists(key string) bool }
Cache
type CacheConfig ¶
type CacheConfig struct { MaxIdle int MaxActive int IdleTimeout time.Duration Host string Auth string }
CacheConfig
type CacheDefault ¶
type CacheDefault struct {
// contains filtered or unexported fields
}
func NewCache ¶
func NewCache(config *CacheConfig) *CacheDefault
func (*CacheDefault) Exists ¶
func (self *CacheDefault) Exists(key string) bool
func (*CacheDefault) Set ¶
func (self *CacheDefault) Set(key string, val interface{}) error
type CipherRequestHttpBody ¶
type CipherResponseHttpBody ¶
type ClientConfig ¶
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
func NewEndpoint ¶
func (*Endpoint) ApiAuthorizerToken ¶
func (*Endpoint) ApiQueryAuth ¶
func (*Endpoint) CommitCode ¶
func (*Endpoint) ComponentAccessTokenUrl ¶
func (*Endpoint) CustomService ¶
func (*Endpoint) FastRegisterWeapp ¶
func (*Endpoint) ModifyDomain ¶
func (*Endpoint) PreAuthCodoUrl ¶
func (*Endpoint) SetBaseUrl ¶
type EventHeaderMessage ¶
type EventMessage ¶
type EventMessage struct { EventHeaderMessage MsgId int64 `xml:"MsgId"` Content string `xml:"Content"` }
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
func NewHttpClient() *HttpClient
func (*HttpClient) Get ¶
func (self *HttpClient) Get(url string) (status int, body []byte, err error)
type Message ¶
type Message interface {
NewTextMessage(w *http.ResponseWriter, text *Text) ([]byte, error)
}
type MessageDecoder ¶
type MessageDecoder struct { Signature string Timestamp string Nonce string MsgSignature string Random []byte EncryptMsg []byte }
func (*MessageDecoder) DecodeComponentVerifyTicket ¶
func (self *MessageDecoder) DecodeComponentVerifyTicket(appId, aesKey string) (NotifyMessage, error)
func (*MessageDecoder) DecodeEventMessage ¶
func (self *MessageDecoder) DecodeEventMessage(appId, aesKey string) (EventMessage, error)
func (*MessageDecoder) VerifySignature ¶
func (self *MessageDecoder) VerifySignature(token string) bool
type MessageEncoder ¶
type MessageEncoder struct { Signature string Timestamp string Nonce string Random []byte RawMsg []byte }
func (*MessageEncoder) EncodeMessage ¶
func (self *MessageEncoder) EncodeMessage(appId, token, aesKey string) (string, error)
type MessageHeader ¶
type NotifyHeaderMessage ¶
type NotifyMessage ¶
type NotifyMessage struct { NotifyHeaderMessage ComponentVerifyTicket string `xml:"ComponentVerifyTicket"` }
type Server ¶
func NewServer ¶
func NewServer(clientConfig *ClientConfig, cache Cache) *Server
func (*Server) EventServe ¶
func (self *Server) EventServe(w http.ResponseWriter, r *http.Request)
func (*Server) NewTextMessage ¶
type Text ¶
type Text struct { MessageHeader Content string `xml:"Content"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.