MCPcopy Create free account
hub / github.com/apache/devlake / TestConnection

Function TestConnection

backend/plugins/taiga/api/connection_api.go:131–144  ·  view source on GitHub ↗

TestConnection tests the Taiga connection @Summary test taiga connection @Description Test Taiga Connection @Tags plugins/taiga @Param body body models.TaigaConnection true "json body" @Success 200 {object} TaigaTestConnResponse "Success" @Failure 400 {string} errcode.Error "Bad Request" @Failure

(input *plugin.ApiResourceInput)

Source from the content-addressed store, hash-verified

129// @Failure 500 {string} errcode.Error "Internal Error"
130// @Router /plugins/taiga/test [POST]
131func TestConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) {
132 // decode
133 var connection models.TaigaConnection
134 err := api.DecodeMapStruct(input.Body, &connection, false)
135 if err != nil {
136 return nil, err
137 }
138 // test connection
139 result, err := testConnection(context.TODO(), connection)
140 if err != nil {
141 return nil, plugin.WrapTestConnectionErrResp(basicRes, err)
142 }
143 return &plugin.ApiResourceOutput{Body: result, Status: http.StatusOK}, nil
144}
145
146// TestExistingConnection tests an existing Taiga connection
147// @Summary test existing taiga connection

Callers

nothing calls this directly

Calls 1

testConnectionFunction · 0.70

Tested by

no test coverage detected