Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: a simple service exposing Search API #8

Merged
merged 10 commits into from
Jan 30, 2024
Merged

Conversation

jachro
Copy link
Contributor

@jachro jachro commented Jan 29, 2024

This PR brings some initial implementation of the Search API service.


trait Implicits:

implicit def entityDecoder[F[_]: Async, A: AvroJsonDecoder]: EntityDecoder[F, A] =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can now use given:) (I might forgot to change that myself when I used code from somewhere else:))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I used metrics collector as a template ;)

import org.http4s.dsl.Http4sDsl
import scribe.Scribe

private class SearchApiImpl[F[_]: Async: Scribe](solrClient: SearchSolrClient[F])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know we have it like this in graph passing in the logger from outside. I'm not sure why that is good? Why wouldn't we want to have different loggers per class?

AvroJsonEncoder.encodeList[ApiProject](ApiProject.SCHEMA$)

private def toAvroResponse(entities: List[ApiProject]): Response[F] =
Response[F](Ok)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with Http4sDsl in scope, I think writing Ok(entities) should work as well. A separate method might then not be needed?

@jachro jachro merged commit a1c8167 into development Jan 30, 2024
2 checks passed
@jachro jachro deleted the search-api branch January 30, 2024 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants