Kuma push
is a package for auto sending heartbeat to uptime-kuma service.
import (
"time"
kuma "github.com/Nigh/kuma-push"
)
func startKuma() {
k := kuma.New("https://kuma.test.cc/api/push/testToken")
k.SetInterval(120 * time.Second)
k.Start()
}
You can set three push parameters by calling these funcs
k.SetStatus("statu")
k.SetMsg("msg")
k.SetPing("123")
You can set the retry count for calling the push url
k.SetRetry(3)
And you can call the stop func to stop the auto heartbeat
k.Stop()
The default parameters of new kuma push instance is below:
{
Status: "up",
Msg: "ok",
Interval: 1 * time.Minute,
Retry: 1
}