TestConnection test github connection @Summary test github connection @Description Test github Connection @Tags plugins/github @Param body body models.GithubConn true "json body" @Success 200 {object} GithubTestConnResponse @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} e
(input *plugin.ApiResourceInput)
| 70 | // @Failure 500 {string} errcode.Error "Internal Error" |
| 71 | // @Router /plugins/github/test [POST] |
| 72 | func TestConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { |
| 73 | // process input |
| 74 | var conn models.GithubConn |
| 75 | e := mapstructure.Decode(input.Body, &conn) |
| 76 | if e != nil { |
| 77 | return nil, errors.Convert(e) |
| 78 | } |
| 79 | testConnectionResult, err := testConnection(context.TODO(), conn) |
| 80 | if err != nil { |
| 81 | return nil, plugin.WrapTestConnectionErrResp(basicRes, err) |
| 82 | } |
| 83 | return &plugin.ApiResourceOutput{Body: testConnectionResult, Status: http.StatusOK}, nil |
| 84 | } |
| 85 | |
| 86 | // @Summary create github connection |
| 87 | // @Description Create github connection |
nothing calls this directly
no test coverage detected