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

Method Validate

internal/store/types.go:1697–1712  ·  view source on GitHub ↗

Validate ensures the query uses sane bounds and one cursor direction.

()

Source from the content-addressed store, hash-verified

1695
1696// Validate ensures the query uses sane bounds and one cursor direction.
1697func (q NetworkConversationMessageQuery) Validate() error {
1698 if strings.TrimSpace(q.BeforeMessageID) != "" && strings.TrimSpace(q.AfterMessageID) != "" {
1699 return fmt.Errorf("store: network conversation message query cannot specify both before and after cursors")
1700 }
1701 if strings.TrimSpace(q.Kind) != "" {
1702 if err := validateNetworkMessageKind(q.Kind); err != nil {
1703 return err
1704 }
1705 }
1706 if strings.TrimSpace(q.WorkID) != "" {
1707 if err := validateNetworkConversationID(q.WorkID, "work_id"); err != nil {
1708 return err
1709 }
1710 }
1711 return requirePositiveLimit(q.Limit, "network conversation message limit")
1712}
1713
1714// NormalizeNetworkDirectRoomPeers validates and orders a two-party room pair.
1715func NormalizeNetworkDirectRoomPeers(peerA string, peerB string) (string, string, error) {

Calls 3

requirePositiveLimitFunction · 0.85

Tested by 1