Documentation
¶
Index ¶
- func NewID() string
- func TodayZero(now time.Time) time.Time
- func TomorrowZero(now time.Time) time.Time
- func TryDownloadBytes(url string, retry int, retryInterval time.Duration) (int, []byte, error)
- func TryDownloadBytesWithHeader(url string, headers map[string]string, retry int, retryInterval time.Duration) (int, []byte, error)
- func TryDownloadString(url string, retry int, retryInterval time.Duration) (string, error)
- func TryDownloadStringWithHeader(url string, headers map[string]string, retry int, retryInterval time.Duration) (string, error)
- func YesterdayZero(now time.Time) time.Time
- type GetAccessTokenResponse
- type WeChatMessageText
- type WeChatSendMessageRequest
- type WeChatSendMessageResponse
- type WeChatService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TomorrowZero ¶
TomorrowZero round time to tomorrow zero clock
func TryDownloadBytes ¶ added in v0.6.2
TryDownloadBytes try download bytes by url
func TryDownloadBytesWithHeader ¶ added in v0.7.0
func TryDownloadBytesWithHeader(url string, headers map[string]string, retry int, retryInterval time.Duration) (int, []byte, error)
TryDownloadBytesWithHeader try download bytes by url
func TryDownloadString ¶ added in v0.6.2
TryDownloadString try download string by url
Types ¶
type GetAccessTokenResponse ¶ added in v0.6.0
type GetAccessTokenResponse struct {
ErrorCode int `json:"errcode"`
ErrorMessage string `json:"errmsg"`
AccessToken string `json:"access_token"`
ExpiresIn int64 `json:"expires_in"`
}
GetAccessTokenResponse response of get access token request
type WeChatMessageText ¶ added in v0.6.0
type WeChatMessageText struct {
Content string `json:"content"`
}
WeChatMessageText wechat message text
type WeChatSendMessageRequest ¶ added in v0.6.0
type WeChatSendMessageRequest struct {
ToUser string `json:"touser"`
MessageType string `json:"msgtype"`
AgentID int `json:"agentid"`
Text WeChatMessageText `json:"text"`
Safe int `json:"safe"`
}
WeChatSendMessageRequest wechat send message request
type WeChatSendMessageResponse ¶ added in v0.6.0
type WeChatSendMessageResponse struct {
ErrorCode int `json:"errcode"`
ErrorMessage string `json:"errmsg"`
InvalidUser string `json:"invaliduser"`
InvalidParty string `json:"invalidparty"`
InvalidTag string `json:"invalidtag"`
}
WeChatSendMessageResponse wechat send message response
type WeChatService ¶ added in v0.6.0
type WeChatService struct {
// contains filtered or unexported fields
}
WeChatService wechat service
func GetWeChatService ¶ added in v0.6.0
func GetWeChatService() *WeChatService
GetWeChatService get wechat service instance
func (WeChatService) GetAccessToken ¶ added in v0.6.0
func (s WeChatService) GetAccessToken() (string, error)
GetAccessToken return fresh access token
func (WeChatService) SendMessage ¶ added in v0.6.0
func (s WeChatService) SendMessage(message string) error
SendMessage send wechat message
Click to show internal directories.
Click to hide internal directories.