This is a Go client library for heartbeat.sh.
Install with go get github.com/heartbeat-sh/heartbeat.go
package main
import (
"fmt"
"github.com/heartbeat-sh/heartbeat.go/heartbeatsh"
"time"
)
func main() {
client := heartbeatsh.NewClient("example")
minute := time.Minute
hour := time.Hour
// Send a beat
err := client.SendBeat("go", &minute, &hour)
if err != nil {
fmt.Printf("Unexpected error %v", err)
}
// Delete a beat
err = client.DeleteBeat("go")
if err != nil {
fmt.Printf("Unexpected error %v", err)
}
}