Skip to content

A go client for working with the healthchecks.io api.

License

Notifications You must be signed in to change notification settings

kristofferahl/go-healthchecksio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-healthchecksio

A go client for working with the healthchecks.io api.

Installation

go get github.com/kristofferahl/go-healthchecksio

Usage

package main

import (
	"log"
	"os"

	"github.com/kristofferahl/go-healthchecksio"
)

func main() {
	apiKey := os.Getenv("HEALTHCHECKSIO_API_KEY") // See https://healthchecks.io/docs/api/

	client := healthchecksio.NewClient(apiKey)
	check := healthchecksio.Healthcheck{
		Name: "My first test",
		Tags: "go ftw",
	}

	healthcheck, err := client.Create(check)
	if err != nil {
		log.Printf("[ERROR] error creating healthcheck: %s", err)
		os.Exit(1)
	}

	log.Printf("[DEBUG] created healthcheck: %s", healthcheck)
}

Documentation

Docs can be found at godoc.org.

Developing

Running the tests requires a valid healthchecks.io API key (See https://healthchecks.io/docs/api/). Make sure the following environment variables are set.

export HEALTHCHECKSIO_API_KEY='{your api key}'

Roadmap

  • Required fields validation

Contributing

...

About

A go client for working with the healthchecks.io api.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages