MCPcopy Create free account
hub / github.com/compozy/agh / parseBoolQuery

Function parseBoolQuery

internal/api/core/agent_channels.go:874–887  ·  view source on GitHub ↗
(c *gin.Context, key string)

Source from the content-addressed store, hash-verified

872}
873
874func parseBoolQuery(c *gin.Context, key string) (bool, error) {
875 if c == nil {
876 return false, nil
877 }
878 raw := strings.TrimSpace(c.Query(key))
879 if raw == "" {
880 return false, nil
881 }
882 parsed, err := strconv.ParseBool(raw)
883 if err != nil {
884 return false, fmt.Errorf("query parameter %q must be a boolean: %w", key, err)
885 }
886 return parsed, nil
887}
888
889func parsePositiveIntQuery(c *gin.Context) (int, error) {
890 const key = "limit"

Callers 7

AgentChannelRecvMethod · 0.85
ListTaskBlocksMethod · 0.85
ListSessionsMethod · 0.85
GetSessionMethod · 0.85
InspectSessionMethod · 0.85

Calls 1

QueryMethod · 0.65

Tested by

no test coverage detected