项目作者: anthonycorbacho

项目描述 :
Starter code for writing services in Go
高级语言: Go
项目地址: git://github.com/anthonycorbacho/foundation.git
创建时间: 2019-09-18T04:35:17Z
项目社区:https://github.com/anthonycorbacho/foundation

开源协议:Apache License 2.0

下载


Foundation CircleCI

This starter kit is a starting point for building production grade scalable Go service applications.
The goal of this Foundation is to provide a proven starting point for new projects that reduce the repetitive tasks in getting a new project launched to production.

This project should not be considered as a “framework”.
This project leaves you in control of your project’s architecture and development.

How to use

  1. // create a GRPC server from github.com/anthonycorbacho/foundation/grpc import.
  2. srv := grpc.NewServer()
  3. defer srv.Stop()
  4. pb.RegisterXXXXXXServer(srv, &myStruct{})
  5. // Create foundation service with prometheus and jeager exporter.
  6. svc := foundation.NewService(":8100", foundation.Name("service_name"))
  7. svc.WithPrometheusExporter(":8101")
  8. svc.WithJaegerExporter("http://127.0.0.1:14268/api/traces", trace.AlwaysSample())
  9. // start the service.
  10. if err := svc.Serve(srv); err != nil {
  11. logger.Fatal("failed to serve", log.Error(err))
  12. }

Contributing

We are welcoming any contribution to the project. If you have a use case or pattern you want to include please feel free to open an issue or create a Pull Request.