Skip to content

Commit

Permalink
get upsert working
Browse files Browse the repository at this point in the history
  • Loading branch information
keefertaylor committed Aug 16, 2024
1 parent 5037039 commit 1d20678
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions health/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ import (
)

type HealthClient interface {
UpsertCheck(slug string) error

SendSuccess(slug string) error
SendFailure(slug string) error
SendFailureWithErr(slug string, err error) error
}

type CreateCheckPayload struct {
Name string `json:"name"`
Slug string `json:"slug"`
Timeout int `json:"timeout"`
Grace int `json:"grace"`
Expand Down Expand Up @@ -119,6 +122,7 @@ func (hc *healthClient) SendFailureWithErr(slug string, err error) error {
func (hc *healthClient) UpsertCheck(slug string) error {
url := "https://healthchecks.io/api/v3/checks/"
createCheckPayload := &CreateCheckPayload{
Name: slug,
Slug: slug,
Timeout: hc.timeoutSeconds,
Grace: hc.gracePeriodSeconds,
Expand Down

0 comments on commit 1d20678

Please sign in to comment.