MCPcopy Index your code
hub / github.com/apache/devlake / TestConnection

Function TestConnection

backend/plugins/gitee/api/connection.go:83–95  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

81// @Failure 500 {string} errcode.Error "Internal Error"
82// @Router /plugins/gitee/test [POST]
83func 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

Callers

nothing calls this directly

Calls 2

WrapMethod · 0.80
testConnectionFunction · 0.70

Tested by

no test coverage detected