mirror of
https://github.com/MedzikUser/go-pingbot
synced 2024-08-14 23:57:07 +00:00
Compare commits
3 commits
6933bd398d
...
f9a954fbd3
Author | SHA1 | Date | |
---|---|---|---|
f9a954fbd3 | |||
d906c0d3b4 | |||
6629a3e1cc |
6 changed files with 17 additions and 7 deletions
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
|
@ -13,7 +13,7 @@ jobs:
|
|||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout v1
|
||||
- name: Repo clone (go mod tidy / gofmt)
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
|
@ -61,10 +61,10 @@ jobs:
|
|||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Checkout v2
|
||||
- name: Repo clone (build)
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: '0'
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
package config
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
const GH_Repo = "MedzikUser/go-pingbot"
|
||||
|
||||
|
@ -8,4 +13,5 @@ var (
|
|||
Version = "dev"
|
||||
Build = ""
|
||||
StartTime time.Time
|
||||
UserAgent = fmt.Sprintf("PingBot/%s go/%s", Version, strings.Replace(runtime.Version(), "go", "", 1))
|
||||
)
|
||||
|
|
2
go.mod
2
go.mod
|
@ -28,7 +28,7 @@ require (
|
|||
go.mongodb.org/mongo-driver v1.7.3
|
||||
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
|
||||
golang.org/x/net v0.0.0-20210825183410-e898025ed96a // indirect
|
||||
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
|
||||
golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1 // indirect
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
|
||||
golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
|
|
4
go.sum
4
go.sum
|
@ -371,8 +371,8 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr
|
|||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw=
|
||||
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1 h1:B333XXssMuKQeBwiNODx4TupZy7bf4sxFZnN2ZOcvUE=
|
||||
golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
|
|
1
main.go
1
main.go
|
@ -24,6 +24,7 @@ type cmdOpts struct {
|
|||
|
||||
func main() {
|
||||
log.Info("You're using verion: ", config.Version)
|
||||
log.Info(config.UserAgent)
|
||||
|
||||
var wg sync.WaitGroup
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/MedzikUser/go-utils/common"
|
||||
"gitlab.com/gaming0skar123/go/pingbot/config"
|
||||
)
|
||||
|
||||
func ping() int {
|
||||
|
@ -30,6 +31,8 @@ func loop(url string) {
|
|||
return
|
||||
}
|
||||
|
||||
req.Header.Set("User-Agent", config.UserAgent)
|
||||
|
||||
client := http.DefaultClient
|
||||
r, err := client.Do(req)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue