mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-03 03:56:18 -04:00
Push Examples (#3735)
This commit is contained in:
parent
9c24cd3973
commit
9ef1e69ae0
13 changed files with 178 additions and 0 deletions
20
extra/push-examples/go/index.go
Normal file
20
extra/push-examples/go/index.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
const PushURL = "https://example.com/api/push/key?status=up&msg=OK&ping="
|
||||
const Interval = 60
|
||||
|
||||
for {
|
||||
_, err := http.Get(PushURL)
|
||||
if err == nil {
|
||||
fmt.Println("Pushed!")
|
||||
}
|
||||
time.Sleep(Interval * time.Second)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue