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

Function testConnection

backend/plugins/feishu/api/connection.go:37–55  ·  view source on GitHub ↗
(ctx context.Context, connection models.FeishuConn)

Source from the content-addressed store, hash-verified

35}
36
37func testConnection(ctx context.Context, connection models.FeishuConn) (*FeishuTestConnResponse, errors.Error) {
38 // validate
39 if vld != nil {
40 if err := vld.Struct(connection); err != nil {
41 return nil, errors.Default.Wrap(err, "error validating target")
42 }
43 }
44 _, err := api.NewApiClientFromConnection(ctx, basicRes, &connection)
45 if err != nil {
46 return nil, err
47 }
48 connection = connection.Sanitize()
49 body := FeishuTestConnResponse{}
50 body.Success = true
51 body.Message = "success"
52 body.Connection = &connection
53
54 return &body, nil
55}
56
57// TestConnection test feishu connection
58// @Summary test feishu connection

Callers 2

TestConnectionFunction · 0.70
TestExistingConnectionFunction · 0.70

Calls 2

WrapMethod · 0.80
SanitizeMethod · 0.45

Tested by 2

TestConnectionFunction · 0.56
TestExistingConnectionFunction · 0.56