Add filtering functionality to server list endpoint (#374)
## Summary - Adds `updated_since`, `search`, and `version` query parameters to `GET /v0/servers` - Enables incremental synchronization via RFC3339 timestamp filtering - Provides simple substring search on server names - Supports latest version filtering with `version=latest` This implementation provides the core filtering capabilities needed for efficient registry synchronization and improved server discovery. Fixes #291 Fixes #135
This commit is contained in:
parent
be6c2d9142
commit
a85456a9b9
1 changed files with 262 additions and 13 deletions
|
|
@ -3,6 +3,7 @@ package database
|
|||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
apiv0 "github.com/modelcontextprotocol/registry/pkg/api/v0"
|
||||
)
|
||||
|
|
@ -19,8 +20,12 @@ var (
|
|||
|
||||
// ServerFilter defines filtering options for server queries
|
||||
type ServerFilter struct {
|
||||
Name *string // for finding versions of same server
|
||||
RemoteURL *string // for duplicate URL detection
|
||||
Name *string // for finding versions of same server
|
||||
RemoteURL *string // for duplicate URL detection
|
||||
UpdatedSince *time.Time // for incremental sync filtering
|
||||
SubstringName *string // for substring search on name
|
||||
Version *string // for exact version matching
|
||||
IsLatest *bool // for filtering latest versions only
|
||||
}
|
||||
|
||||
// Database defines the interface for database operations
|
||||
|
|
|
|||
Loading…
Reference in a new issue