Merge branch 'master' into mark-as-unread
Этот коммит содержится в:
@@ -268,6 +268,10 @@ func (c *Client4) GetTestEmailRoute() string {
|
||||
return fmt.Sprintf("/email/test")
|
||||
}
|
||||
|
||||
func (c *Client4) GetTestSiteURLRoute() string {
|
||||
return fmt.Sprintf("/site_url/test")
|
||||
}
|
||||
|
||||
func (c *Client4) GetTestS3Route() string {
|
||||
return fmt.Sprintf("/file/s3_test")
|
||||
}
|
||||
@@ -2922,6 +2926,18 @@ func (c *Client4) TestEmail(config *Config) (bool, *Response) {
|
||||
return CheckStatusOK(r), BuildResponse(r)
|
||||
}
|
||||
|
||||
// TestSiteURL will test the validity of a site URL.
|
||||
func (c *Client4) TestSiteURL(siteURL string) (bool, *Response) {
|
||||
requestBody := make(map[string]string)
|
||||
requestBody["site_url"] = siteURL
|
||||
r, err := c.DoApiPost(c.GetTestSiteURLRoute(), MapToJson(requestBody))
|
||||
if err != nil {
|
||||
return false, BuildErrorResponse(r, err)
|
||||
}
|
||||
defer closeBody(r)
|
||||
return CheckStatusOK(r), BuildResponse(r)
|
||||
}
|
||||
|
||||
// TestS3Connection will attempt to connect to the AWS S3.
|
||||
func (c *Client4) TestS3Connection(config *Config) (bool, *Response) {
|
||||
r, err := c.DoApiPost(c.GetTestS3Route(), config.ToJson())
|
||||
|
||||
Ссылка в новой задаче
Block a user