-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #198 from yoyofx/dev
Dev
- Loading branch information
Showing
45 changed files
with
824 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
|
||
go.sum | ||
__debug_bin | ||
**/vendor/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package tests | ||
|
||
import ( | ||
"encoding/json" | ||
"gopkg.in/go-playground/assert.v1" | ||
"grafanaalertwebhook/wechatrequests" | ||
"testing" | ||
) | ||
|
||
func TestMessage(t *testing.T) { | ||
|
||
var message *wechatrequests.MarkdownMessage | ||
message = &wechatrequests.MarkdownMessage{ | ||
Markdown: struct { | ||
Content string `json:"content" gorm:"column:content"` | ||
}{ | ||
Content: "## " + "test" + ",请相关同事注意。\n" + | ||
" > [报警信息] : " + "test" + "\n" + | ||
" > [报警次数] : <font color=\"warning\">" + "0" + "次</font>" + "\n" + | ||
" > [报警明细] : (" + "app" + ")\n", | ||
}, | ||
Msgtype: "markdown", | ||
} | ||
|
||
msg, _ := json.Marshal(message) | ||
msgStr := string(msg) | ||
|
||
//return sendUrl + msgStr | ||
dd := wechatrequests.PostWechatMessage("https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=93fb0726-9794-49f5-b10f-dac3c85396da", msgStr) | ||
|
||
assert.Equal(t, dd != "", true) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
module mvcdemo | ||
|
||
|
||
go 1.16 | ||
|
||
require ( | ||
github.com/yoyofxteam/dependencyinjection v1.0.0 | ||
github.com/yoyofx/yoyogo v0.0.0 | ||
github.com/yoyofx/yoyogo v0.0.0 | ||
github.com/yoyofxteam/dependencyinjection v1.0.1 | ||
) | ||
|
||
replace github.com/yoyofx/yoyogo => ../../ | ||
replace github.com/yoyofx/yoyogo => ../../ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM alpine | ||
|
||
#更新Alpine的软件源为国内源,提高下载速度 | ||
RUN echo "https://mirror.tuna.tsinghua.edu.cn/alpine/v3.4/main/" > /etc/apk/repositories | ||
|
||
RUN apk update \ | ||
&& apk upgrade \ | ||
&& apk add --no-cache bash \ | ||
bash-doc \ | ||
bash-completion \ | ||
&& rm -rf /var/cache/apk/* \ | ||
&& /bin/bash | ||
# 设置时区为上海 | ||
RUN apk -U add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ | ||
&& echo "Asia/Shanghai" > /etc/timezone \ | ||
&& apk del tzdata | ||
|
||
|
||
COPY /examples/simpleweb/app / | ||
COPY /examples/simpleweb/config_dev.yml / | ||
|
||
|
||
ENTRYPOINT ["/app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,89 @@ | ||
module simpleweb | ||
|
||
go 1.16 | ||
go 1.18 | ||
|
||
require ( | ||
github.com/fasthttp/websocket v1.4.3 | ||
github.com/fasthttp/websocket v1.5.0 | ||
github.com/go-sql-driver/mysql v1.6.0 | ||
github.com/jinzhu/copier v0.3.2 // indirect | ||
github.com/yoyofx/yoyogo v0.0.0 | ||
github.com/yoyofxteam/dependencyinjection v1.0.1 | ||
github.com/yoyofxteam/reflectx v0.2.3 // indirect | ||
gorm.io/gorm v1.21.11 | ||
) | ||
|
||
require ( | ||
github.com/SkyAPM/go2sky v1.1.0 // indirect | ||
github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 // indirect | ||
github.com/andybalholm/brotli v1.0.4 // indirect | ||
github.com/beorn7/perks v1.0.1 // indirect | ||
github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23 // indirect | ||
github.com/cespare/xxhash/v2 v2.1.1 // indirect | ||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect | ||
github.com/emicklei/dot v0.16.0 // indirect | ||
github.com/fogleman/gg v1.3.0 // indirect | ||
github.com/fsnotify/fsnotify v1.4.9 // indirect | ||
github.com/go-errors/errors v1.0.1 // indirect | ||
github.com/go-playground/locales v0.13.0 // indirect | ||
github.com/go-playground/universal-translator v0.17.0 // indirect | ||
github.com/go-playground/validator/v10 v10.4.1 // indirect | ||
github.com/go-redis/redis/v8 v8.11.0 // indirect | ||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect | ||
github.com/golang/protobuf v1.5.2 // indirect | ||
github.com/google/uuid v1.3.0 // indirect | ||
github.com/hashicorp/hcl v1.0.0 // indirect | ||
github.com/jinzhu/copier v0.3.2 // indirect | ||
github.com/jinzhu/inflection v1.0.0 // indirect | ||
github.com/jinzhu/now v1.1.2 // indirect | ||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect | ||
github.com/json-iterator/go v1.1.11 // indirect | ||
github.com/klauspost/compress v1.15.0 // indirect | ||
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect | ||
github.com/leodido/go-urn v1.2.0 // indirect | ||
github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f // indirect | ||
github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042 // indirect | ||
github.com/magiconair/properties v1.8.5 // indirect | ||
github.com/mattn/go-colorable v0.1.4 // indirect | ||
github.com/mattn/go-isatty v0.0.12 // indirect | ||
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect | ||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect | ||
github.com/mitchellh/mapstructure v1.4.1 // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
github.com/modern-go/reflect2 v1.0.1 // indirect | ||
github.com/nacos-group/nacos-sdk-go v1.0.7 // indirect | ||
github.com/pelletier/go-toml v1.9.3 // indirect | ||
github.com/pkg/errors v0.9.1 // indirect | ||
github.com/prometheus/client_golang v1.11.0 // indirect | ||
github.com/prometheus/client_model v0.2.0 // indirect | ||
github.com/prometheus/common v0.26.0 // indirect | ||
github.com/prometheus/procfs v0.6.0 // indirect | ||
github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899 // indirect | ||
github.com/sirupsen/logrus v1.6.0 // indirect | ||
github.com/spf13/afero v1.6.0 // indirect | ||
github.com/spf13/cast v1.3.1 // indirect | ||
github.com/spf13/jwalterweatherman v1.1.0 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
github.com/spf13/viper v1.8.1 // indirect | ||
github.com/subosito/gotenv v1.2.0 // indirect | ||
github.com/toolkits/concurrent v0.0.0-20150624120057-a4371d70e3e3 // indirect | ||
github.com/ugorji/go/codec v1.2.1 // indirect | ||
github.com/valyala/bytebufferpool v1.0.0 // indirect | ||
github.com/valyala/fasthttp v1.35.0 // indirect | ||
github.com/yoyofxteam/reflectx v0.2.3 // indirect | ||
go.uber.org/atomic v1.7.0 // indirect | ||
go.uber.org/multierr v1.6.0 // indirect | ||
go.uber.org/zap v1.17.0 // indirect | ||
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect | ||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b // indirect | ||
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect | ||
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9 // indirect | ||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect | ||
golang.org/x/text v0.3.7 // indirect | ||
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect | ||
google.golang.org/grpc v1.45.0 // indirect | ||
google.golang.org/protobuf v1.26.0 // indirect | ||
gopkg.in/ini.v1 v1.62.0 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
gorm.io/driver/mysql v1.1.1 // indirect | ||
skywalking.apache.org/repo/goapi v0.0.0-20210401062122-a049ca15c62d // indirect | ||
) | ||
|
||
replace github.com/yoyofx/yoyogo => ../../ |
Oops, something went wrong.