Our great sponsors
-
Gin
Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
Nacos
an easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
validator
:100:Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving
-
Grafana
The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
-
consul
Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.
-
protoc-gen-validate
Discontinued protoc plugin to generate polyglot message validators [Moved to: https://github.com/bufbuild/protoc-gen-validate] (by envoyproxy)
-
sponge
Sponge is a powerful Go development framework, it's easy to develop web and microservice projects.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
Web framework gin
RPC framework grpc
Configuration file parsing viper
Configuration Center nacos
Caching component go-redis ristretto
Documentation swagger
Authorization jwt
Validator validator
Monitoring prometheus, grafana
Monitoring prometheus, grafana
Service registry and discovery etcd, consul, nacos
Service registry and discovery etcd, consul, nacos
Code inspection golangci-lint
Continuous Integration CI jenkins
Continuous Deployment CD docker, kubernetes
The code directory structure follows project-layout, and the code directory structure is shown below.
Download it from https://github.com/protocolbuffers/protobuf/releases/tag/v3.20.3 and add the directory where the protoc file is located under systempath.
Dependency plugins and tools are automatically installed after executing the command: protoc-gen-go, protoc-gen-go-grpc, protoc-gen-validate, protoc-gen-gotag, protoc-gen-go-gin, protoc-gen-go-rpc-tmpl, protoc-gen-openapiv2, protoc-gen-doc, golangci-lint, swag, go-callvis.
Check the parameter description command sponge web http -h, note that the parameter repo-addr is the image repository address, if you use the official docker image repository, you only need to fill in the username of the registered docker repository, if you use the private repository address, you need to fill in the full repository address.
Dependency plugins and tools are automatically installed after executing the command: protoc-gen-go, protoc-gen-go-grpc, protoc-gen-validate, protoc-gen-gotag, protoc-gen-go-gin, protoc-gen-go-rpc-tmpl, protoc-gen-openapiv2, protoc-gen-doc, golangci-lint, swag, go-callvis.
Dependency plugins and tools are automatically installed after executing the command: protoc-gen-go, protoc-gen-go-grpc, protoc-gen-validate, protoc-gen-gotag, protoc-gen-go-gin, protoc-gen-go-rpc-tmpl, protoc-gen-openapiv2, protoc-gen-doc, golangci-lint, swag, go-callvis.
Dependency plugins and tools are automatically installed after executing the command: protoc-gen-go, protoc-gen-go-grpc, protoc-gen-validate, protoc-gen-gotag, protoc-gen-go-gin, protoc-gen-go-rpc-tmpl, protoc-gen-openapiv2, protoc-gen-doc, golangci-lint, swag, go-callvis.
Dependency plugins and tools are automatically installed after executing the command: protoc-gen-go, protoc-gen-go-grpc, protoc-gen-validate, protoc-gen-gotag, protoc-gen-go-gin, protoc-gen-go-rpc-tmpl, protoc-gen-openapiv2, protoc-gen-doc, golangci-lint, swag, go-callvis.
Dependency plugins and tools are automatically installed after executing the command: protoc-gen-go, protoc-gen-go-grpc, protoc-gen-validate, protoc-gen-gotag, protoc-gen-go-gin, protoc-gen-go-rpc-tmpl, protoc-gen-openapiv2, protoc-gen-doc, golangci-lint, swag, go-callvis.
Use jaeger for tracing and elasticsearch for storage, and start both services locally using docker-compose.
Using the wrk tool to pressure test the api
Rate limiter and circuit breaker use a third-party library aegis, which adapts according to system resources and error rates. Since different servers have different processing capabilities and parameters are not well set, using adaptive parameters avoids the trouble of manually setting parameters for each service.
Related posts
- Otterize launches open-source, declarative IAM permissions for workloads on AWS EKS clusters
- Is there a good example of an open source non-trivial (DB connection, authentication, authorization, data validation, tests, etc...) Go API?
- My favourite backend tools
- Ask HN: Who is hiring? (May 2021)
- Gopher Gold #20 - Wed Nov 18 2020