Skip to content

Commit

Permalink
Discovery: search API for clients (#2672)
Browse files Browse the repository at this point in the history
* Discovery: API for client and server

* revert

* add note, pr feedback
  • Loading branch information
reinkrul authored Jan 9, 2024
1 parent 085c43d commit adff763
Show file tree
Hide file tree
Showing 9 changed files with 491 additions and 11 deletions.
269 changes: 269 additions & 0 deletions discovery/api/v1/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions discovery/api/v1/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,19 @@ func (w *Wrapper) RegisterPresentation(_ context.Context, request RegisterPresen
}
return RegisterPresentation201Response{}, nil
}

func (w *Wrapper) SearchPresentations(_ context.Context, request SearchPresentationsRequestObject) (SearchPresentationsResponseObject, error) {
searchResults, err := w.Client.Search(request.ServiceID, request.Params.Query)
if err != nil {
return nil, err
}
var result []SearchResult
for _, searchResult := range searchResults {
result = append(result, SearchResult{
Vp: searchResult.Presentation,
Id: searchResult.Presentation.ID.String(),
Fields: searchResult.Fields,
})
}
return SearchPresentations200JSONResponse(result), nil
}
Loading

0 comments on commit adff763

Please sign in to comment.