MCPcopy
hub / github.com/apache/devlake / validateConnection

Function validateConnection

backend/plugins/gh-copilot/api/connection.go:92–106  ·  view source on GitHub ↗
(connection *models.GhCopilotConnection)

Source from the content-addressed store, hash-verified

90}
91
92func validateConnection(connection *models.GhCopilotConnection) errors.Error {
93 if connection == nil {
94 return errors.BadInput.New("connection is required")
95 }
96 if connection.Organization == "" && !connection.HasEnterprise() {
97 return errors.BadInput.New("either enterprise or organization is required")
98 }
99 if connection.Token == "" {
100 return errors.BadInput.New("token is required")
101 }
102 if connection.RateLimitPerHour < 0 {
103 return errors.BadInput.New("rateLimitPerHour must be non-negative")
104 }
105 return nil
106}

Calls 2

HasEnterpriseMethod · 0.80
NewMethod · 0.65