https://github.com/crazy-max/gohealthchecks
Go client library for accessing the Healthchecks API
https://github.com/crazy-max/gohealthchecks
api-client golang golang-library healthchecks
Last synced: 19 days ago
JSON representation
Go client library for accessing the Healthchecks API
- Host: GitHub
- URL: https://github.com/crazy-max/gohealthchecks
- Owner: crazy-max
- License: mit
- Created: 2020-10-11T14:37:44.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-25T21:32:33.000Z (about 1 year ago)
- Last Synced: 2024-10-30T03:22:16.543Z (6 months ago)
- Topics: api-client, golang, golang-library, healthchecks
- Language: Go
- Homepage: https://pkg.go.dev/github.com/crazy-max/gohealthchecks
- Size: 69.3 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Support: .github/SUPPORT.md
Awesome Lists containing this project
README
## About
Go client library for accessing the [Healthchecks API](https://healthchecks.io/docs/http_api/).
## Installation
```
go get github.com/crazy-max/gohealthchecks
```## Usage
```go
package mainimport (
"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**](https://github.com/sponsors/crazy-max) or by making
a [Paypal donation](https://www.paypal.me/crazyws) to ensure this journey continues indefinitely!Thanks again for your support, it is much appreciated! :pray:
## License
MIT. See `LICENSE` for more details.