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

Function AIBridgeClients

coderd/searchquery/search.go:481–507  ·  view source on GitHub ↗
(query string, page codersdk.Pagination)

Source from the content-addressed store, hash-verified

479}
480
481func AIBridgeClients(query string, page codersdk.Pagination) (database.ListAIBridgeClientsParams, []codersdk.ValidationError) {
482 // nolint:exhaustruct // Empty values just means "don't filter by that field".
483 filter := database.ListAIBridgeClientsParams{
484 // #nosec G115 - Safe conversion for pagination offset which is expected to be within int32 range
485 Offset: int32(page.Offset),
486 // #nosec G115 - Safe conversion for pagination limit which is expected to be within int32 range
487 Limit: int32(page.Limit),
488 }
489
490 if query == "" {
491 return filter, nil
492 }
493
494 values, errors := searchTerms(query, func(term string, values url.Values) error {
495 values.Add("client", term)
496 return nil
497 })
498 if len(errors) > 0 {
499 return filter, errors
500 }
501
502 parser := httpapi.NewQueryParamParser()
503 filter.Client = parser.String(values, "", "client")
504
505 parser.ErrorExcessParams(values)
506 return filter, parser.Errors
507}
508
509// Tasks parses a search query for tasks.
510//

Callers 1

aiBridgeListClientsMethod · 0.92

Calls 5

StringMethod · 0.95
ErrorExcessParamsMethod · 0.95
NewQueryParamParserFunction · 0.92
searchTermsFunction · 0.85
AddMethod · 0.65

Tested by

no test coverage detected