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

Function ListConnections

backend/plugins/webhook/api/connection.go:202–217  ·  view source on GitHub ↗

ListConnections @Summary get all webhook connections @Description Get all webhook connections @Tags plugins/webhook @Success 200 {object} []WebhookConnectionResponse @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/webhook/con

(input *plugin.ApiResourceInput)

Source from the content-addressed store, hash-verified

200// @Failure 500 {string} errcode.Error "Internal Error"
201// @Router /plugins/webhook/connections [GET]
202func ListConnections(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) {
203 var connections []models.WebhookConnection
204 err := connectionHelper.List(&connections)
205 if err != nil {
206 return nil, err
207 }
208 responseList := []*WebhookConnectionResponse{}
209 for _, connection := range connections {
210 webhookConnectionResponse, err := formatConnection(&connection, true)
211 if err != nil {
212 return nil, err
213 }
214 responseList = append(responseList, webhookConnectionResponse)
215 }
216 return &plugin.ApiResourceOutput{Body: responseList, Status: http.StatusOK}, nil
217}
218
219// GetConnection
220// @Summary get webhook connection detail

Callers

nothing calls this directly

Calls 2

formatConnectionFunction · 0.85
ListMethod · 0.45

Tested by

no test coverage detected