TestConnection test gitee connection @Summary test gitee connection @Description Test gitee Connection. endpoint: https://gitee.com/api/v5/ @Tags plugins/gitee @Param body body models.GiteeConn true "json body" @Success 200 {object} GiteeTestConnResponse "Success" @Failure 400 {string} errcode.Err
(input *plugin.ApiResourceInput)
| 81 | // @Failure 500 {string} errcode.Error "Internal Error" |
| 82 | // @Router /plugins/gitee/test [POST] |
| 83 | func TestConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { |
| 84 | var err errors.Error |
| 85 | var connection models.GiteeConn |
| 86 | if err = helper.Decode(input.Body, &connection, vld); err != nil { |
| 87 | return nil, errors.BadInput.Wrap(err, "could not decode request parameters") |
| 88 | } |
| 89 | // test connection |
| 90 | result, err := testConnection(context.TODO(), connection) |
| 91 | if err != nil { |
| 92 | return nil, plugin.WrapTestConnectionErrResp(basicRes, err) |
| 93 | } |
| 94 | return &plugin.ApiResourceOutput{Body: result, Status: http.StatusOK}, nil |
| 95 | } |
| 96 | |
| 97 | // TestExistingConnection test gitee connection |
| 98 | // @Summary test gitee connection |
nothing calls this directly
no test coverage detected