MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / parseRFC3339Filter

Function parseRFC3339Filter

internal/httpapi/messages.go:664–675  ·  view source on GitHub ↗

parseRFC3339Filter parses an optional RFC3339 timestamp query param into a time, returning a 400 envelope on a malformed value.

(raw, name string)

Source from the content-addressed store, hash-verified

662// parseRFC3339Filter parses an optional RFC3339 timestamp query param into
663// a time, returning a 400 envelope on a malformed value.
664func parseRFC3339Filter(raw, name string) (time.Time, error) {
665 raw = strings.TrimSpace(raw)
666 if raw == "" {
667 return time.Time{}, nil
668 }
669 t, err := time.Parse(time.RFC3339, raw)
670 if err != nil {
671 return time.Time{}, NewError(http.StatusBadRequest, "invalid_filter",
672 name+" must be RFC3339 (e.g. 2026-05-25T00:00:00Z)")
673 }
674 return t, nil
675}
676
677func rfc3339OrEmpty(t time.Time) string {
678 if t.IsZero() {

Callers 3

handleListMessagesMethod · 0.85
parseRFC3339FilterPtrFunction · 0.85

Calls 1

NewErrorFunction · 0.85

Tested by

no test coverage detected