TestConnection test gitlab connection @Summary test gitlab connection @Description Test gitlab Connection @Tags plugins/gitlab @Param body body models.GitlabConn true "json body" @Success 200 {object} GitlabTestConnResponse "Success" @Failure 400 {string} errcode.Error "Bad Request" @Failure 500
(input *plugin.ApiResourceInput)
| 83 | // @Failure 500 {string} errcode.Error "Internal Error" |
| 84 | // @Router /plugins/gitlab/test [POST] |
| 85 | func TestConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { |
| 86 | // decode |
| 87 | var err errors.Error |
| 88 | var connection models.GitlabConn |
| 89 | if err = api.Decode(input.Body, &connection, vld); err != nil { |
| 90 | return nil, err |
| 91 | } |
| 92 | result, err := testConnection(context.TODO(), connection) |
| 93 | if err != nil { |
| 94 | return nil, plugin.WrapTestConnectionErrResp(basicRes, err) |
| 95 | } |
| 96 | return &plugin.ApiResourceOutput{Body: result, Status: http.StatusOK}, nil |
| 97 | } |
| 98 | |
| 99 | // TestExistingConnection test gitlab connection |
| 100 | // @Summary test gitlab connection |
nothing calls this directly
no test coverage detected