sdgmf / go-project-sample Goto Github PK
View Code? Open in Web Editor NEWIntroduce the best practice experience of Go project with a complete project example.通过一个完整的项目示例介绍Go语言项目的最佳实践经验.
License: Apache License 2.0
Introduce the best practice experience of Go project with a complete project example.通过一个完整的项目示例介绍Go语言项目的最佳实践经验.
License: Apache License 2.0
如果再添加个路由层感觉结构更完美。另外感谢分享!
The codahale/hdrhistogram repo has been transferred under the github HdrHstogram umbrella with the help from the original author in Sept 2020 (new repo url https://github.com/HdrHistogram/hdrhistogram-go). The main reasons are to group all implementations under the same roof and to provide more active contribution from the community as the original repository was archived several years ago.
The dependency URL should be modified to point to the new repository URL. The tag "v0.9.0" was applied at the point of transfer and will reflect the exact code that was frozen in the original repository.
If you are using Go modules, you can update to the exact point of transfer using the @v0.9.0 tag in your go get command.
go mod edit -replace github.com/codahale/hdrhistogram=github.com/HdrHistogram/[email protected]
From the point of transfer, up until now (mon 16 aug 2021), we've released 3 versions that aim support the standard HdrHistogram serialization/exposition formats, and deeply improve READ performance.
We recommend to update to the latest version.
grpc 客户端连接没有关闭,会引起内在泄露,参考
https://book.eddycjy.com/golang/talk/talking-grpc.html
$ make docker-compose
for app in 'products' 'details' 'ratings' 'reviews' ;
do
GOOS=linux GOARCH="amd64" go build -o dist/$app-linux-amd64 ./cmd/$app/;
GOOS=darwin GOARCH="amd64" go build -o dist/$app-darwin-amd64 ./cmd/$app/;
done
for app in 'products' 'details' 'ratings' 'reviews' ;
do
jsonnet -J ./grafana/grafonnet-lib -o ./scripts/grafana/dashboards/$app.json --ext-str app=$app ./scripts/grafana/dashboard.jsonnet ;
done
RUNTIME ERROR: couldn't open import "grafonnet/grafana.libsonnet": no match locally or in the Jsonnet library paths.
./scripts/grafana/dashboard.jsonnet:1:17-53 thunk
./scripts/grafana/dashboard.jsonnet:2:19-26 thunk
./scripts/grafana/dashboard.jsonnet:238:1-10
RUNTIME ERROR: couldn't open import "grafonnet/grafana.libsonnet": no match locally or in the Jsonnet library paths.
./scripts/grafana/dashboard.jsonnet:1:17-53 thunk
./scripts/grafana/dashboard.jsonnet:2:19-26 thunk
./scripts/grafana/dashboard.jsonnet:238:1-10
RUNTIME ERROR: couldn't open import "grafonnet/grafana.libsonnet": no match locally or in the Jsonnet library paths.
./scripts/grafana/dashboard.jsonnet:1:17-53 thunk
./scripts/grafana/dashboard.jsonnet:2:19-26 thunk
./scripts/grafana/dashboard.jsonnet:238:1-10
RUNTIME ERROR: couldn't open import "grafonnet/grafana.libsonnet": no match locally or in the Jsonnet library paths.
./scripts/grafana/dashboard.jsonnet:1:17-53 thunk
./scripts/grafana/dashboard.jsonnet:2:19-26 thunk
./scripts/grafana/dashboard.jsonnet:238:1-10
make: *** [dash] Error 1
不知是哪里不对?
https://www.infoq.cn/article/4TAWp8YNYcVD4t046EGd
阅读这篇文章过来,跟文章中的改进:分离业务逻辑这一层还有点差距
It's difficult to recurrent the make proto
command generate similar code. Could you offer the versions of your proto generation tools? Including the protoc, proto-gen-go, protoc-gen-go-grpc, etc.
老板,我是ubuntu18.04。编译都成功了,就http://localhost:8080/product/1不能访问
我用docker-compose up 发现如下问题:
level=warn ts=2020-11-09T07:26:57.142Z caller=notify.go:674 component=dispatcher receiver=email integration=email[0] msg="Notify attempt failed, will retry later" attempts=1 err="establish connection to server: dial tcp: address tcp/port: unknown port"
level=error ts=2020-11-09T07:27:17.143Z caller=dispatch.go:309 component=dispatcher msg="Notify for alerts failed" num_alerts=4 err="email/email[0]: notify retry canceled after 7 attempts: establish connection to server: dial tcp: address tcp/port: unknown port"
这两个找不到端口
克隆下项目后,直接cd go-project-sample/下运行make docker-compose,发生报错:
couldn't open import "grafonnet-lib/grafonnet/grafana.libsonnet": no match locally or in the Jsonnet library paths
发现下面这个路径下是空的:
go-project-sample/scripts/grafana/grafonnet-lib/
建议把https://github.com/grafana/grafonnet-lib/tree/master/grafonnet
文件夹直接copy进去,能正常运行。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.