Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
taoey committed Aug 6, 2023
1 parent 2c9d408 commit 69a127b
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 274 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@
*.out

/vendor/**
/.idea/**
/.idea/**
*.html
*.tar.gz
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"go.testFlags": ["-v"]
"go.testFlags": ["-v"],
"go.goroot": "/root/soft/go",
"go.gopath": "/root/soft/gopath",
}
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,16 @@ gowatch -p ./main.go


### 注释插件
Goanno
Goanno



### 配置prometheus
docker run \
-p 8797:9090 \
-v /root/soft/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheus


docker run -d --name grafana -p 8795:3000 grafana/grafana grafana
120.46.173.6:8795
16 changes: 16 additions & 0 deletions dockerfile.tmp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM golang:alpine AS builder
RUN apk add --no-cache ca-certificates \
make \
git
COPY . /go-build
RUN cd /go-build && \
export GO111MODULE=on && \
export GOPROXY=https://goproxy.io && \
go build -o 'golang-exe' path/to/main/

FROM alpine
RUN apk add --no-cache tzdata
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs
COPY --from=builder /go-build/golang-exe /usr/bin/golang-exe
ENV TZ Asia/Shanghai
CMD ["golang-exe"]
26 changes: 26 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,31 @@ require (
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.4.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cilium/ebpf v0.9.3 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/cosiner/argv v0.1.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/cweill/gotests v1.6.0 // indirect
github.com/davidrjenni/reftools v0.0.0-20210213085015-40322ffdc2e4 // indirect
github.com/derekparker/trie v0.0.0-20200317170641-1fdf38b7b0e9 // indirect
github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/flosch/pongo2/v4 v4.0.2 // indirect
github.com/goccy/go-json v0.9.5 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/fatih/structtag v1.2.0 // indirect
github.com/go-delve/delve v1.9.1 // indirect
github.com/go-delve/liner v1.2.3-0.20220127212407-d32d89dd2a5d // indirect
github.com/godoctor/godoctor v0.0.0-20220520165350-b665b8ff3f35 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/go-dap v0.6.0 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/iris-contrib/jade v1.1.4 // indirect
github.com/iris-contrib/schema v0.0.6 // indirect
Expand Down Expand Up @@ -64,12 +82,20 @@ require (
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/yosssi/ace v0.0.5 // indirect
go.etcd.io/etcd/api/v3 v3.5.6 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.6 // indirect
go.etcd.io/etcd/client/v3 v3.5.6 // indirect
go.starlark.net v0.0.0-20221028183056-acb66ad56dd2 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect
golang.org/x/tools v0.3.0 // indirect
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
google.golang.org/grpc v1.41.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
Expand Down
249 changes: 0 additions & 249 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func main() {
sysinit.InitLogger()

//sysinit.InitMongo()
//sysinit.InitQuartz()
sysinit.InitCron()
//sysinit.InitMysql()

router.SetRoutes(App)
Expand Down
24 changes: 24 additions & 0 deletions pkg/sysinit/init_cron.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package sysinit

import (
"fmt"
"time"

"github.com/bamzi/jobrunner"
)

func InitCron() {
jobrunner.Start()
// jobrunner.Schedule("@every 2s", PrintTime{})

}

// 打印时间任务
type PrintTime struct {
}

func (p PrintTime) Run() {
fmt.Println("time:", time.Now())
}

// docker run -dit -p 8797:9090 -v /root/soft/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
21 changes: 0 additions & 21 deletions pkg/sysinit/init_quartz.go

This file was deleted.

0 comments on commit 69a127b

Please sign in to comment.