Skip to content

heartbeat-sh/heartbeat.go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Heartbeat.sh Go Client

This is a Go client library for heartbeat.sh.

Usage

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)
	}
}