Giter VIP home page Giter VIP logo

sdgmf / go-project-sample Goto Github PK

View Code? Open in Web Editor NEW
521.0 17.0 101.0 544 KB

Introduce the best practice experience of Go project with a complete project example.通过一个完整的项目示例介绍Go语言项目的最佳实践经验.

License: Apache License 2.0

Makefile 1.77% Go 70.53% Dockerfile 0.53% PLpgSQL 2.82% Shell 6.02% Jsonnet 18.33%
golang wire gin gorm prometheus opentracing inject microservice best-practice grpc

go-project-sample's People

Contributors

deepsource-io[bot] avatar sdgmf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-project-sample's Issues

老板,启动有点问题

老板,我是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"
这两个找不到端口

无法运行项目

$ 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

不知是哪里不对?

make docker-compose报错

克隆下项目后,直接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进去,能正常运行。

codahale/hdrhistogram repo url has been transferred under the github HdrHstogram umbrella

Problem

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]

Performance Improvements

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.