Skip to content

Commit

Permalink
Discovery: API for client and server
Browse files Browse the repository at this point in the history
  • Loading branch information
reinkrul committed Jan 9, 2024
1 parent 085c43d commit 7a81266
Show file tree
Hide file tree
Showing 9 changed files with 489 additions and 12 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 7a81266

Please sign in to comment.