MCPcopy Create free account
hub / github.com/tbphp/gpt-load / validateKeysText

Function validateKeysText

internal/handler/key_handler.go:41–48  ·  view source on GitHub ↗

validateKeysText validates the keys text input Returns false if validation fails (error is already sent to client)

(c *gin.Context, keysText string)

Source from the content-addressed store, hash-verified

39// validateKeysText validates the keys text input
40// Returns false if validation fails (error is already sent to client)
41func validateKeysText(c *gin.Context, keysText string) bool {
42 if strings.TrimSpace(keysText) == "" {
43 response.ErrorI18nFromAPIError(c, app_errors.ErrValidation, "validation.keys_text_empty")
44 return false
45 }
46
47 return true
48}
49
50// findGroupByID is a helper function to find a group by its ID.
51func (s *Server) findGroupByID(c *gin.Context, groupID uint) (*models.Group, bool) {

Callers 6

AddMultipleKeysMethod · 0.85
AddMultipleKeysAsyncMethod · 0.85
DeleteMultipleKeysMethod · 0.85
RestoreMultipleKeysMethod · 0.85
TestMultipleKeysMethod · 0.85

Calls 1

ErrorI18nFromAPIErrorFunction · 0.92

Tested by

no test coverage detected