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(discovery): add kind field in order to discover the check type #7

Closed
wants to merge 1 commit into from

Conversation

FlorentinDUBOIS
Copy link

Resolve #4.

@FlorentinDUBOIS FlorentinDUBOIS requested a review from urcadox April 10, 2018 10:48
@urcadox
Copy link
Contributor

urcadox commented Apr 10, 2018

Will review that tomorrow :)

@urcadox
Copy link
Contributor

urcadox commented Apr 12, 2018

Alright so, 2 things:

  • Only adding a kind field to the existing (http) check does not really work. The existing Check case class has properties specific to the http check (secure and path).
  • If we were to do this, the kind field should be an Enum, something like this:
sealed trait CheckKind

case object HTTP extends CheckKind
case object DNS extends CheckKind
case object SSL extends CheckKind

Here though, what we have to do is have a Check trait and multiple case classes which implement this trait.

Then, when serializing, use pattern matching to add the relevant kind property.

Database-wise though, it would be best to use separate tables for every check kind, though we could get away with using a single table with a few constraints to keep it clean.

@urcadox urcadox closed this Dec 6, 2018
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