MCPcopy Index your code
hub / github.com/coder/coder / validateAIProviderName

Function validateAIProviderName

codersdk/aiproviders.go:305–317  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

303}
304
305func validateAIProviderName(name string) []ValidationError {
306 var validations []ValidationError
307 switch {
308 case name == "":
309 validations = append(validations, ValidationError{Field: "name", Detail: "name is required"})
310 case !AIProviderNameRegex.MatchString(name):
311 validations = append(validations, ValidationError{
312 Field: "name",
313 Detail: fmt.Sprintf("name must match %s (lowercase alphanumeric, hyphens between words)", AIProviderNameRegex),
314 })
315 }
316 return validations
317}
318
319func validateRequiredAIProviderBaseURL(raw string) []ValidationError {
320 if raw == "" {

Callers 1

ValidateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected