Nigh / kuma-push

auto heartbeats for uptime-kuma

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kuma-push

GitHub Repo stars Software License uptime-kuma

Kuma push is a package for auto sending heartbeat to uptime-kuma service.

Usage

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
}

About

auto heartbeats for uptime-kuma

License:MIT License


Languages

Language:Go 100.0%