Documentation ¶
Index ¶
- Variables
- func ContainsInSlice(items []string, item string) bool
- func GreenColor(s interface{}) string
- func JsonToMap(str string) map[string]interface{}
- func RedColor(s interface{}) string
- func YellowColor(s interface{}) string
- type APIError
- type CMClient
- func (c *CMClient) IsLogged() bool
- func (c *CMClient) LoginWithToken(BearerAuthToken string) *CMClient
- func (c *CMClient) SendImage(webhookurl, base64, md5 string) (*wxWorkResponse, error)
- func (c *CMClient) SendMarkdown(webhookurl, content string) (*wxWorkResponse, error)
- func (c *CMClient) SendNews(webhookurl, title, description, url, picurl string) (*wxWorkResponse, error)
- func (c *CMClient) SendText(webhookurl string, content string, mentioned_list []string, ...) (*wxWorkResponse, error)
- func (c *CMClient) SetDebug(enable bool) *CMClient
- type Image
- type Markdown
- type News
- type NewsArticle
- type Text
- type WxWorkBot
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnsupportedMessage = errors.New("尚不支持的消息类型")
)
Functions ¶
func ContainsInSlice ¶
ContainsInSlice 判断字符串是否在 slice 中
func GreenColor ¶
func GreenColor(s interface{}) string
func YellowColor ¶
func YellowColor(s interface{}) string
Types ¶
type APIError ¶
type APIError struct { Code int `json:"code"` Data interface{} `json:"data,omitempty"` Msg string `json:"msg"` Errors []struct { Resource string `json:"resource"` Field string `json:"field"` Code string `json:"code"` } `json:"errors,omitempty"` }
APIError represents the error message that GitHub API returns. GitHub API doc: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#client-errors
type CMClient ¶
type CMClient struct { *req.Client // contains filtered or unexported fields }
GithubClient is the go client for GitHub API.
func (*CMClient) LoginWithToken ¶
LoginWithToken login with GitHub personal access token.
func (*CMClient) SendMarkdown ¶
SendMarkdown Send Markdown
func (*CMClient) SendNews ¶
func (c *CMClient) SendNews(webhookurl, title, description, url, picurl string) (*wxWorkResponse, error)
SendNews Send News
type News ¶
type News struct {
Articles []NewsArticle `json:"articles"`
}
type NewsArticle ¶
Click to show internal directories.
Click to hide internal directories.