GithubHelp home page GithubHelp logo

cloudwego / hertz Goto Github PK

View Code? Open in Web Editor NEW
4.9K 53.0 482.0 3.11 MB

Go HTTP framework with high-performance and strong-extensibility for building micro-services.

Home Page: https://www.cloudwego.io

License: Apache License 2.0

Makefile 0.05% Go 99.61% Shell 0.30% Thrift 0.05%
go http microservices

hertz's Introduction

Hertz

English | 中文

Release WebSite License Go Report Card OpenIssue ClosedIssue Stars Forks

Hertz [həːts] is a high-usability, high-performance and high-extensibility Golang HTTP framework that helps developers build microservices. It was designed with reference to other open-source frameworks like fasthttp, gin, echo and combined with the internal requirements in ByteDance. At present, it has been widely used inside ByteDance. Nowadays, more and more microservices use Golang. If you have requirements for microservice performance and hope that the framework can fully meet the internal customizable requirements, Hertz will be a good choice.

Basic Features

  • High usability

    During the development process, it is often more important to write the correct code quickly. Therefore, in the iterative process of Hertz, we actively listen to users' opinions and continue to polish the framework, hoping to provide users with a better user experience and help users write correct code faster.

  • High performance

    Hertz uses the self-developed high-performance network library Netpoll by default. In some special scenarios, compared to Go Net, Hertz has certain advantages in QPS and time delay. For performance data, please refer to the Echo data in the figure below.

    Comparison of four frameworks: Performance Comparison of three frameworks: Performance For detailed performance data, please refer to hertz-benchmark.

  • High extensibility

    Hertz adopts a layered design, providing more interfaces and default extension implementations. Users can also extend by themselves. At the same time, thanks to the layered design of the framework, the extensibility of the framework will be much greater. At present, only stable capabilities are open-sourced to the community. More planning refers to RoadMap.

  • Multi-protocol support

    The Hertz framework provides HTTP/1.1, HTTP/2, HTTP/3, ALPN protocol support natively. In addition, due to the layered design, Hertz even supports custom build protocol resolution logic to meet any needs of protocol layer extensions.

  • Network layer switching capability

    Hertz implements the function to switch between Netpoll and Go Net on demand. Users can choose the appropriate network library for different scenarios. And Hertz also supports the extension of network library in the form of plug-ins.

Documentation

Example

The Hertz-Examples repository provides code out of the box. more

Basic Features

Contains introduction and use of general middleware, context selection, data binding, data rendering, direct access, logging, error handling. more

Observability

Contains instrumentation, logging, tracing, monitoring, OpenTelemetry integration. more

Service Governance

Contains service registration and discovery extensions, Sentinel integration. more

Framework Extension

Contains network library extensions. more

Reference

Apidoc, framework configurable items list. more

FAQ

Frequently Asked Questions. more

Performance

Performance testing can only provide a relative reference. In production, there are many factors that can affect actual performance. We provide the hertz-benchmark project to track and compare the performance of Hertz and other frameworks in different situations for reference.

Related Projects

  • Netpoll: A high-performance network library. Hertz integrated by default.
  • Hertz-contrib: A partial extension library of Hertz, which users can integrate into Hertz through options according to their needs.
  • Example: Use examples of Hertz.

Extensions

Extensions Description
Autotls Make Hertz support Let's Encrypt.
Http2 HTTP2 support for Hertz.
Websocket Enable Hertz to support the Websocket protocol.
Etag Support ETag (or entity tag) HTTP response header for Hertz.
Limiter Provides a current limiter based on the bbr algorithm.
Monitor-prometheus Provides service monitoring based on Prometheus.
Obs-opentelemetry Hertz's Opentelemetry extension that supports Metric, Logger, Tracing and works out of the box.
Opensergo The Opensergo extension.
Pprof Extension for Hertz integration with Pprof.
Registry Provides service registry and discovery functions. So far, the supported service discovery extensions are nacos, consul, etcd, eureka, polaris, servicecomb, zookeeper, redis.
Sentry Sentry extension provides some unified interfaces to help users perform real-time error monitoring.
Tracer Link tracing based on Opentracing.
Basicauth Basicauth middleware can provide HTTP basic authentication.
Jwt Jwt extension.
Keyauth Provides token-based authentication.
Requestid Add request id in response.
Sessions Session middleware with multi-state store support.
Casbin Supports various access control models by Casbin.
Cors Provides cross-domain resource sharing support.
Csrf Csrf middleware is used to prevent cross-site request forgery attacks.
Secure Secure middleware with multiple configuration items.
Gzip A Gzip extension with multiple options.
I18n Helps translate Hertz programs into multi programming languages.
Lark Use hertz handle Lark/Feishu card message and event callback.
Loadbalance Provides load balancing algorithms for Hertz.
Logger Logger extension for Hertz, which provides support for zap, logrus, zerologs logging frameworks.
Recovery Recovery middleware for Hertz.
Reverseproxy Implement a reverse proxy.
Swagger Automatically generate RESTful API documentation with Swagger 2.0.
Cache Hertz middleware for cache HTTP response with multi-backend support

Blogs

Contributing

Contributing

RoadMap

Hertz RoadMap

License

Hertz is distributed under the Apache License, version 2.0. The licenses of third party dependencies of Hertz are explained here.

Community

LarkGroup

Contributors

Thank you for your contribution to Hertz!

Contributors

Landscapes

  

CloudWeGo enriches the CNCF CLOUD NATIVE Landscape.

hertz's People

Contributors

a631807682 avatar alice-yyds avatar baize1998 avatar bodhisatan avatar byene0923 avatar chaoranz758 avatar cqqqq777 avatar demomanito avatar duslia avatar fgyffff avatar guangmingluo avatar hanson avatar haswf avatar joway avatar justlorain avatar l2nce avatar lgbgbl avatar li-jin-gou avatar likzn avatar mamil avatar purewhitewu avatar rogerogers avatar seigec avatar skyenought avatar violapioggia avatar welkeyever avatar wzekin avatar yangruiemma avatar ypo2478 avatar zhoulilily 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  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

hertz's Issues

[docs]: translate hertz/tutorials/basic-feature/protocol, log, err handle

[docs]: translate hertz/reference/version & json

version:
zh web page:https://www.cloudwego.io/zh/docs/hertz/reference/version/
zh doc:https://github.com/cloudwego/cloudwego.github.io/blob/main/content/zh/docs/hertz/reference/version.md
en folder:https://github.com/cloudwego/cloudwego.github.io/tree/main/content/en/docs/hertz/reference

json:
zh web page:https://www.cloudwego.io/zh/docs/hertz/reference/json/
zh doc:https://github.com/cloudwego/cloudwego.github.io/blob/main/content/zh/docs/hertz/reference/json.md
en folder:https://github.com/cloudwego/cloudwego.github.io/tree/main/content/en/docs/hertz/reference

Notes:

Do not change the original layout, code style or content sequence.
Software Translator is a tool, not god, do not use the result as the final result.
Translation principle: faithfulness, expressiveness and elegance.
Submit your PR here in this repo.

feat:support brotli/br

Is your feature request related to a problem? Please describe.

hertz only support gzip in fs.go. may support brotli/br?

Describe the solution you'd like

I think hertz can support it like valyala/fasthttp#880

Describe alternatives you've considered

Additional context

no api gateway provided?

Api gateway is the most important part if you use microservices. No one can be found good in golang world.

run `hz` to generate api in windows ,fails with relativePath

Describe the bug

in windows 11,when run hz update -I idl -idl idl/hello/hello.proto failed :

To Reproduce

Steps to reproduce the behavior:

  1. follow the guide in https://www.cloudwego.io/zh/docs/hertz/tutorials/toolkit/toolkit/
  2. run command hz update -I idl -idl idl/hello/hello.proto
  3. error occured.
  4. err log
F:\go\franchiserMgmt>F:\go\franchiserMgmt>hz update -I idl -idl idl/hello/hello.proto
plugin protoc_gen_hertz returns error: exit status 1, cause:
Could not make proto path relative: F:\go\franchiserMgmt\idl\hello\hello.proto: No such file or directory

idl gnerated

Screenshots

If applicable, add screenshots to help explain your problem.

Hertz version:
F:\go\franchiserMgmt>hz -v
hz version v0.1.0

Please provide the version of Hertz you are using.

Environment:

set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\czyt\AppData\Local\go-build
set GOENV=C:\Users\czyt\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\czyt\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\czyt\go
set GOPRIVATE=
set GOPROXY=https://goproxy.cn,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.18.3
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=F:\go\franchiserMgmt\go.mod
set GOWORK=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\czyt\AppData\Local\Temp\go-build85752684=/tmp/go-build -gno-record-gcc-switches

[docs]: translate hertz/tutorials/basic-feature/graceful-shutdown, forward-proxy, unit-test

[docs]: translate hertz/tutorials/basic-feature/stream

zh web page:https://www.cloudwego.io/zh/docs/hertz/tutorials/basic-feature/stream/
zh doc:https://github.com/cloudwego/cloudwego.github.io/blob/main/content/zh/docs/hertz/tutorials/basic-feature/stream.md
en folder:https://github.com/cloudwego/cloudwego.github.io/tree/main/content/en/docs/hertz/tutorials

Notes:

  • Do not change the original layout, code style or content sequence.
  • Software Translator is a tool, not god, do not use the result as the final result.
  • Translation principle: faithfulness, expressiveness and elegance.
  • Submit your PR here in this repo.

Proposal: Add reload mechanism to html render

Describe the solution you'd like

Add or replace the way of rendering HTML in order to let the server reload HTML templates without restarting.

Describe alternatives you've considered

A timer or a file system watcher may help to decide whether to reload or not.

Additional context

Be aware of performance overhead. DO NOT reload it every time when render api is called.

HTTP1: add remote ip when reading error happened

Is your feature request related to a problem? Please describe.

If get a none http1 request, hertz will print an error message but without an ip address of the client. It is difficult to trace the problem to the client.

Describe the solution you'd like

Add more info including the remote ip of the client may help.

[docs]: translate hertz/tutorials/example

zh web page:https://www.cloudwego.io/zh/docs/hertz/tutorials/example/
zh doc:https://github.com/cloudwego/cloudwego.github.io/blob/main/content/zh/docs/hertz/tutorials/example/_index.md
en folder:https://github.com/cloudwego/cloudwego.github.io/tree/main/content/en/docs/hertz/tutorials

Notes:

  1. Do not change the original layout, code style or content sequence.
  2. Software Translator is a tool, not god, do not use the result as the final result.
  3. Translation principle: faithfulness, expressiveness and elegance.
  4. Submit your PR here in this repo.

basic auth middleware example in cloudwego.io is not working

Describe the bug

basic-auth middleware example in cloudwego.io is not working.

When I tried to build for it, an error occured.

main.go:7:2: no required module provides package github.com/cloudwego/hertz/pkg/app/middlewares/basic_auth; to add it:
        go get github.com/cloudwego/hertz/pkg/app/middlewares/basic_auth

Then I found that required module should be github.com/cloudwego/hertz/pkg/app/middlewares/server/basic_auth instead of github.com/cloudwego/hertz/pkg/app/middlewares/basic_auth.

However, compile failed again when I solved the problem above.

# command-line-arguments
./main.go:29:23: undefined: basic_auth.AuthUserKey

AuthUserKey is not defined in package github.com/cloudwego/hertz/pkg/app/middlewares/server/basic_auth.

[docs]: translate hertz/tutorials/basic-feature/network-lib

zh web page:https://www.cloudwego.io/zh/docs/hertz/tutorials/basic-feature/network-lib/
zh doc:https://github.com/cloudwego/cloudwego.github.io/blob/main/content/zh/docs/hertz/tutorials/basic-feature/network-lib.md
en folder:https://github.com/cloudwego/cloudwego.github.io/tree/main/content/en/docs/hertz/tutorials/basic-feature

Notes:

  1. Do not change the original layout, code style or content sequence.
  2. Software Translator is a tool, not god, do not use the result as the final result.
  3. Translation principle: faithfulness, expressiveness and elegance.
  4. Submit your PR here in this repo.

[docs]: translate hertz tutorials/tutorials/service-governance/monitoring/

monitoring:
zh web page:https://www.cloudwego.io/zh/docs/hertz/tutorials/service-governance/monitoring/
zh doc:https://github.com/cloudwego/cloudwego.github.io/blob/main/content/zh/docs/hertz/tutorials/service-governance/monitoring.md
en folder:https://github.com/cloudwego/cloudwego.github.io/tree/main/content/en/docs/hertz/tutorials

Notes:

Do not change the original layout, code style or content sequence.
Software Translator is a tool, not god, do not use the result as the final result.
Translation principle: faithfulness, expressiveness and elegance.
Submit your PR here in this repo.

[docs]: Update the translation of hertz Getting Started

zh web page:https://www.cloudwego.io/zh/docs/hertz/getting-started/
zh doc:https://github.com/cloudwego/cloudwego.github.io/blob/main/content/zh/docs/hertz/getting-started/_index.md
en folder:https://github.com/cloudwego/cloudwego.github.io/blob/main/content/en/docs/hertz/getting-started/_index.md

Notes:

  • Do not change the original layout, code style or content sequence.
  • Software Translator is a tool, not god, do not use the result as the final result.
  • Translation principle: faithfulness, expressiveness and elegance.
  • Submit your PR here in this repo.

Add more comments

Describe the solution you'd like

Add more clear comments.

  1. Comments for all public struct and functions

:memo: [docs]: translate hertz/faq/

faq:
zh web page:https://www.cloudwego.io/zh/docs/hertz/faq/
zh doc:https://github.com/cloudwego/cloudwego.github.io/blob/main/content/zh/docs/hertz/faq/_index.md
en folder:https://github.com/cloudwego/cloudwego.github.io/tree/main/content/en/docs/hertz/faq

Notes:

Do not change the original layout, code style or content sequence.
Software Translator is a tool, not god, do not use the result as the final result.
Translation principle: faithfulness, expressiveness and elegance.
Submit your PR here in this repo.

feat: change the type of Data in protobuf render for avoiding panic

Is your feature request related to a problem? Please describe.

bytes, err := proto.Marshal(r.Data.(proto.Message))
if err != nil {
return err
}

r.Data is an empty interface object, panic occurs when r.Data doesn't implement proto.Message.

Describe the solution you'd like
Before:

// ProtoBuf contains the given interface object.
type ProtoBuf struct {
Data interface{}
}

hertz/pkg/app/context.go

Lines 866 to 869 in 48fb76f

// ProtoBuf serializes the given struct as ProtoBuf into the response body.
func (ctx *RequestContext) ProtoBuf(code int, obj interface{}) {
ctx.Render(code, render.ProtoBuf{Data: obj})
}

After:

type ProtoBuf struct {
	Data proto.Message
}
func (ctx *RequestContext) ProtoBuf(code int, obj proto.Message) {
	ctx.Render(code, render.ProtoBuf{Data: obj})
}

Changing the type of Data in protobuf render directly is a solution. When obj doesn't implement proto.Message, compiling will failed. I think it is more useful to avoid panic in runtime.

Expect to provide configuration center management

Is your feature request related to a problem? Please describe.

In the case of too many service instances, we need a unified configuration center to manage the configuration

Describe the solution you'd like

Provides access to configuration centers like Nacos, apollo, etc.

Add more examples

Describe the solution you'd like

Add more representative easy-to-use examples

Netpoll prints connection error when wrk stress test ends

possible to show us how to test with wrk or apache bench? coz cant test against fasthttp etc.
got this as response

2022/05/31 14:13:56 readv(fd=59) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=58) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=57) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=56) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=55) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=54) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=53) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=51) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=49) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=48) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=47) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=46) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=45) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=44) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=43) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=41) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=40) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=39) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=38) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=36) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=34) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=33) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=32) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=31) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=30) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=29) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=28) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=27) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=26) failed: connection reset by peer
2022/05/31 14:13:56 readv(fd=25) failed: connection reset by peer

ab -n 100 -c 100 http://127.0.0.1:8888/
This is ApacheBench, Version 2.3 <$Revision: 1843412 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)...apr_pollset_poll: The timeout specified has expired (70007)

[docs]: translate hertz tutorials/toolkit/toolkit/

toolkit:
zh web page:https://www.cloudwego.io/zh/docs/hertz/tutorials/toolkit/toolkit/
zh doc:https://github.com/cloudwego/cloudwego.github.io/blob/main/content/zh/docs/hertz/tutorials/toolkit/toolkit.md
en folder:https://github.com/cloudwego/cloudwego.github.io/tree/main/content/en/docs/hertz/tutorials

Notes:

Do not change the original layout, code style or content sequence.
Software Translator is a tool, not god, do not use the result as the final result.
Translation principle: faithfulness, expressiveness and elegance.
Submit your PR here in this repo.

[docs]: translate hertz/tutorials/framework-exten/advanced-exten/protocol/

protocol:
zh web page:https://www.cloudwego.io/zh/docs/hertz/tutorials/framework-exten/advanced-exten/protocol/
zh doc:https://github.com/cloudwego/cloudwego.github.io/blob/main/content/zh/docs/hertz/tutorials/framework-exten/advanced-exten/protocol.md
en folder:https://github.com/cloudwego/cloudwego.github.io/tree/main/content/en/docs/hertz/tutorials

Notes:

Do not change the original layout, code style or content sequence.
Software Translator is a tool, not god, do not use the result as the final result.
Translation principle: faithfulness, expressiveness and elegance.
Submit your PR here in this repo.

Hope Hertz supports swagger middleware

Is your feature request related to a problem? Please describe.

Recently I work on the mall preject, I want to reconstruct the api layer to Hertz, but I need a swagger tool to generate api doc

Describe the solution you'd like

support Hertz swagger middleware

Describe alternatives you've considered

Additional context

[docs]: translate hertz/tutorials/tutorials/framework-exten/monitor & log

希望可以支持服务过载检测和限流相关算法

Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like

A clear and concise description of what you want to happen.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

[docs]: translate hertz/tutorials/toolkit/template/

template:
zh web page:https://www.cloudwego.io/zh/docs/hertz/tutorials/toolkit/template/
zh doc:https://github.com/cloudwego/cloudwego.github.io/blob/main/content/zh/docs/hertz/tutorials/toolkit/template.md
en folder:https://github.com/cloudwego/cloudwego.github.io/tree/main/content/en/docs/hertz/tutorials

Notes:

Do not change the original layout, code style or content sequence.
Software Translator is a tool, not god, do not use the result as the final result.
Translation principle: faithfulness, expressiveness and elegance.
Submit your PR here in this repo.

feat: add Custom inerface in IRoutes interface

Is your feature request related to a problem? Please describe.

may hertz suport Custom interface for IRoutes ?

Describe the solution you'd like
Custom([]string, string, ...app.HandlerFunc) IRoutes

and the implemention like

func (group *RouterGroup) Custom(httpMethods []string, relativePath string, handlers ...app.HandlerFunc) IRoutes {
	if len(httpMethods) == 0 {
		panic("can't find any http method")
	}
	for _, httpMethod := range httpMethods {
		if matches, err := regexp.MatchString("^[A-Z]+$", httpMethod); !matches || err != nil {
			panic("http method " + httpMethod + " is not valid")
		}
		group.handle(httpMethod, relativePath, handlers)
	}
	return group.returnObj()
}

Describe alternatives you've considered

Additional context

[docs]: translate hertz/tutorials/basic-feature/bindAndValidate

zh web page:https://www.cloudwego.io/zh/docs/hertz/tutorials/basic-feature/binding-and-validate/
zh doc:https://github.com/cloudwego/cloudwego.github.io/blob/main/content/zh/docs/hertz/tutorials/basic-feature/binding-and-validate.md
en folder:https://github.com/cloudwego/cloudwego.github.io/tree/main/content/en/docs/hertz/tutorials

Notes:

  • Do not change the original layout, code style or content sequence.
  • Software Translator is a tool, not god, do not use the result as the final result.
  • Translation principle: faithfulness, expressiveness and elegance.
  • Submit your PR here in this repo.

Are you using Hertz ?

The purpose of this issue

We are always interested in finding out who is using Hertz, what attracted you to using it, how we can listen to your needs and if you are interested, help promote your organization.

  • We have people reaching out to us asking, who uses Hertz in production?
  • We’d like to listen to what you would like to see in Hertz and your scenarios?
  • We'd like to help promote your organization and work with you

What we would like from you

Submit a comment in this issue to include the following information

  • Your organization or company
  • Link to your website
  • Your country
  • Your contact info to reach out to you: blog, email or Twitter (at least one).
  • What is your scenario for using Hertz?
  • Are you running you application in Testing or Production?
Organization/Company: ByteDance
Website: https://bytedance.com
Country: China
Contact: [email protected]
Usage scenario: Using Hertz to build large scale Cloud Native applications
Status: Production

about Tracer add more simple demo or example

Link tracing is a fundamental piece of information needed in every environment in the project, can it be started by default at the log or database level? In addition, can you give an example that is more friendly to newbies and can be used out of the box, although there is an example in the hertz example, it does not meet the basic needs.

Add a startup log to display the name of the loaded network library

Is your feature request related to a problem? Please describe.

no

Describe the solution you'd like

route.GetTransporterName() returns the name of network library, printing an INFO log with it will work.

Describe alternatives you've considered

By the way, add a unit test for route.GetTransporterName() to ensure the correctness.

Close connection after responding a short connection request (http1 case)

Is your feature request related to a problem? Please describe.

In #23, if http1 server does not close connection after responding the short connection request from ab(apache bench), ab will wait until timeout.

Describe the solution you'd like

A quick way to make it work is closing the connection from the server side.

Describe alternatives you've considered

Be careful about the error processing logic. Do not break any other rule other than this "short connection" case

Additional context

Before: Hertz assumes that the initiator of the short connection will actively disconnect the connection.

[docs]: translate hertz/reference/config/

config:
zh web page:https://www.cloudwego.io/zh/docs/hertz/reference/config/
zh doc:https://github.com/cloudwego/cloudwego.github.io/blob/main/content/zh/docs/hertz/reference/config.md
en folder:https://github.com/cloudwego/cloudwego.github.io/tree/main/content/en/docs/hertz/reference

Notes:

Do not change the original layout, code style or content sequence.
Software Translator is a tool, not god, do not use the result as the final result.
Translation principle: faithfulness, expressiveness and elegance.
Submit your PR here in this repo.

[docs]: translate hertz/tutorials/tutorials/service-governance/tracing/

tracing:
zh web page:https://www.cloudwego.io/zh/docs/hertz/tutorials/service-governance/tracing/
zh doc:https://github.com/cloudwego/cloudwego.github.io/blob/main/content/zh/docs/hertz/tutorials/service-governance/tracing.md
en folder:https://github.com/cloudwego/cloudwego.github.io/tree/main/content/en/docs/hertz/tutorials

Notes:

Do not change the original layout, code style or content sequence.
Software Translator is a tool, not god, do not use the result as the final result.
Translation principle: faithfulness, expressiveness and elegance.
Submit your PR here in this repo.

[docs]: translate hertz/tutorials/framework-exten/advanced-exten/network-lib/

network-lib:
zh web page:https://www.cloudwego.io/zh/docs/hertz/tutorials/framework-exten/advanced-exten/network-lib/
zh doc:https://github.com/cloudwego/cloudwego.github.io/blob/main/content/zh/docs/hertz/tutorials/framework-exten/advanced-exten/network-lib.md
en folder:https://github.com/cloudwego/cloudwego.github.io/tree/main/content/en/docs/hertz/tutorials

Notes:

Do not change the original layout, code style or content sequence.
Software Translator is a tool, not god, do not use the result as the final result.
Translation principle: faithfulness, expressiveness and elegance.
Submit your PR here in this repo.

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.