0
0
Fork 0
mirror of https://github.com/crazy-max/diun.git synced 2025-05-13 19:11:41 +00:00
crazy-max_diun/vendor/github.com/crazy-max/gohealthchecks
dependabot[bot] a12e347d9b
chore(deps): bump github.com/crazy-max/gohealthchecks
Bumps [github.com/crazy-max/gohealthchecks](https://github.com/crazy-max/gohealthchecks) from 0.4.1 to 0.5.0.
- [Release notes](https://github.com/crazy-max/gohealthchecks/releases)
- [Commits](https://github.com/crazy-max/gohealthchecks/compare/v0.4.1...v0.5.0)

---
updated-dependencies:
- dependency-name: github.com/crazy-max/gohealthchecks
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 07:25:06 +00:00
..
.dockerignore chore(deps): bump github.com/crazy-max/gohealthchecks 2024-12-23 07:25:06 +00:00
.editorconfig chore: go mod vendor 2024-12-14 22:30:21 +01:00
.gitignore chore(deps): bump github.com/crazy-max/gohealthchecks 2024-12-23 07:25:06 +00:00
.golangci.yml chore(deps): bump github.com/crazy-max/gohealthchecks 2024-12-23 07:25:06 +00:00
codecov.yml chore(deps): bump github.com/crazy-max/gohealthchecks 2024-12-23 07:25:06 +00:00
doc.go chore(deps): bump github.com/crazy-max/gohealthchecks 2024-12-23 07:25:06 +00:00
docker-bake.hcl chore(deps): bump github.com/crazy-max/gohealthchecks 2024-12-23 07:25:06 +00:00
Dockerfile chore(deps): bump github.com/crazy-max/gohealthchecks 2024-12-23 07:25:06 +00:00
healthchecks.go chore(deps): bump github.com/crazy-max/gohealthchecks 2024-12-23 07:25:06 +00:00
LICENSE chore(deps): bump github.com/crazy-max/gohealthchecks 2024-12-23 07:25:06 +00:00
pinging.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
README.md chore: go mod vendor 2024-12-14 22:30:21 +01:00

PkgGoDev Test workflow Go Report Codecov
Become a sponsor Donate Paypal

About

Go client library for accessing the Healthchecks API.

Installation

go get github.com/crazy-max/gohealthchecks

Usage

package main

import (
	"context"
	"log"
	"net/url"

	"github.com/crazy-max/gohealthchecks"
)

func main() {
	var err error
	
	// Default client uses https://hc-ping.com/
	// client := gohealthchecks.NewClient(nil)

	hcBaseURL, err := url.Parse("https://hc.foo.com")
	if err != nil {
		log.Fatal(err)
	}
	client := gohealthchecks.NewClient(&gohealthchecks.ClientOptions{
		BaseURL: hcBaseURL,
	})

	err = client.Start(context.Background(), gohealthchecks.PingingOptions{
		UUID: "5bf66975-d4c7-4bf5-bcc8-b8d8a82ea278",
		Logs: "Job started!",
	})
	if err != nil {
		log.Fatal(err)
	}

	err = client.Success(context.Background(), gohealthchecks.PingingOptions{
		UUID: "5bf66975-d4c7-4bf5-bcc8-b8d8a82ea278",
		Logs: "Job completed!",
	})
	if err != nil {
		log.Fatal(err)
	}

	err = client.Fail(context.Background(), gohealthchecks.PingingOptions{
		UUID: "5bf66975-d4c7-4bf5-bcc8-b8d8a82ea278",
		Logs: "Job failed...",
	})
	if err != nil {
		log.Fatal(err)
	}
}

Contributing

Want to contribute? Awesome! The most basic way to show your support is to star the project, or to raise issues. You can also support this project by becoming a sponsor on GitHub or by making a Paypal donation to ensure this journey continues indefinitely!

Thanks again for your support, it is much appreciated! 🙏

License

MIT. See LICENSE for more details.