目录
dependabot[bot]

chore(deps): bump the cloudwego-dependencies group across 7 directories with 1 update (#195)

Bumps the cloudwego-dependencies group with 1 update in the / directory: github.com/cloudwego/hertz. Bumps the cloudwego-dependencies group with 1 update in the /bizdemo/hertz_gorm directory: github.com/cloudwego/hertz. Bumps the cloudwego-dependencies group with 1 update in the /bizdemo/hertz_jwt directory: github.com/cloudwego/hertz. Bumps the cloudwego-dependencies group with 1 update in the /bizdemo/hertz_session directory: github.com/cloudwego/hertz. Bumps the cloudwego-dependencies group with 1 update in the /bizdemo/hertz_swagger_gen directory: github.com/cloudwego/hertz. Bumps the cloudwego-dependencies group with 1 update in the /bizdemo/tiktok_demo directory: github.com/cloudwego/hertz. Bumps the cloudwego-dependencies group with 1 update in the /hz_kitex_demo/hertz-server directory: github.com/cloudwego/hertz.

Updates github.com/cloudwego/hertz from 0.10.5 to 0.10.6

Updates github.com/cloudwego/hertz from 0.10.5 to 0.10.6

Updates github.com/cloudwego/hertz from 0.10.5 to 0.10.6

Updates github.com/cloudwego/hertz from 0.10.5 to 0.10.6

Updates github.com/cloudwego/hertz from 0.10.5 to 0.10.6

Updates github.com/cloudwego/hertz from 0.10.5 to 0.10.6

Updates github.com/cloudwego/hertz from 0.10.5 to 0.10.6


updated-dependencies:

  • dependency-name: github.com/cloudwego/hertz dependency-version: 0.10.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cloudwego-dependencies
  • dependency-name: github.com/cloudwego/hertz dependency-version: 0.10.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cloudwego-dependencies
  • dependency-name: github.com/cloudwego/hertz dependency-version: 0.10.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cloudwego-dependencies
  • dependency-name: github.com/cloudwego/hertz dependency-version: 0.10.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cloudwego-dependencies
  • dependency-name: github.com/cloudwego/hertz dependency-version: 0.10.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cloudwego-dependencies
  • dependency-name: github.com/cloudwego/hertz dependency-version: 0.10.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cloudwego-dependencies
  • dependency-name: github.com/cloudwego/hertz dependency-version: 0.10.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cloudwego-dependencies …

Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

1个月前117次提交

Hertz Examples

English | 中文

如何运行

请进入对应示例目录查看运行说明。除非示例另有说明,所有命令都应在仓库根目录执行。

业务示例

  • bizdemo/hertz_gorm:使用 Thrift IDL、hz、Hertz 参数绑定与校验、GORM 和 MySQL 构建 Hertz 服务。
  • bizdemo/hertz_jwt:在 Hertz 服务中使用 JWT 认证、GORM 和 MySQL。
  • bizdemo/hertz_session:在 Hertz 服务中使用基于 Redis 的分布式 Session 和 CSRF 防护。
  • bizdemo/hertz_swagger_gen:使用 thrift-gen-http-swagger 从 Thrift IDL 生成 Swagger 文档和 Swagger UI 服务。
  • bizdemo/tiktok_demo:包含用户、视频、社交、Feed、点赞、评论和消息服务的简易 Hertz 后端。
  • formulago:使用 Hertz 和 Ent 构建的企业级后台管理框架。
  • gpress:使用 Hertz 和 Go 模板构建的 Web3 内容平台,支持 FTS5 全文搜索和 Hugo 生态。

服务端

  • hello:基础的 Hertz “hello world” 服务。
  • config:配置 Hertz 服务端。
  • protocol:在 Hertz 中使用 HTTP/1.1 和 TLS,并链接到其他协议示例。
    • HTTP1:Hertz HTTP/1.1 服务示例。
    • TLS:TLS 服务端,以及使用 Hertz 客户端发送 TLS 请求的示例。
    • HTTP2:外部 Hertz HTTP/2 示例。
    • HTTP3:基于 QUIC 的外部 Hertz HTTP/3 示例。
    • WebSocket:外部 Hertz WebSocket 示例。
    • SSE:使用 Hertz 内置 SSE 包实现的服务端和客户端示例。
  • middleware:服务端中间件示例,包括 BasicAuth、CORS、CSRF、自定义中间件、pprof、RequestID、Gzip 和负载均衡。
    • basicauth:使用 BasicAuth 中间件。
    • CORS:使用 CORS 中间件。
    • csrf:配置 CSRF 中间件,包括自定义 token 提取和跳过规则。
    • custom:编写并注册自定义中间件。
    • pprof:配置 pprof 中间件。
    • requestid:配置 RequestID 中间件和自定义 ID 处理逻辑。
    • gzip:配置 Gzip 压缩以及路由/路径排除规则。
    • loadbalance:配置非默认的负载均衡算法。
    • Recovery:使用内置 Recovery 中间件。
    • JWT:使用 JWT 认证中间件。
    • i18n:使用国际化中间件。
    • session:使用支持 Cookie 或 Redis 后端的 Session 中间件。
    • KeyAuth:使用可配置的 key 查找方式认证请求。
    • Swagger:在 Hertz 中提供 Swagger 文档。
    • access log:记录 HTTP 访问详情。
    • Secure:配置安全相关的 HTTP Header 和重定向。
    • Sentry:将 Hertz 请求错误上报到 Sentry。
    • Casbin:使用 Casbin 授权中间件。
    • ETag:添加 ETag 响应 Header 并自定义 ETag 行为。
    • Cache:使用内存或 Redis 后端缓存 Hertz 响应。
    • Paseto:使用 PASETO token 保护路由。
  • binding:绑定并校验请求参数。
  • parameters:读取 query、form 和 cookie 参数。
  • file:上传、下载文件,提供静态文件服务,并从文件或模板渲染 HTML。
  • render:渲染 JSON、HTML、Protobuf、文本、XML 和自定义 YAML 响应。
  • redirect:将请求重定向到内部或外部 URI。
  • route:注册静态路由、路由组、参数路由和带中间件的路由,并查看路由信息。
  • streaming:在 Hertz 服务端流式读取请求体和写入响应体。
  • graceful_shutdown:优雅退出 Hertz 服务。
  • unit_test:使用 ResponseRecordPerformRequest 在没有网络传输的情况下测试 Hertz Handler。
  • monitoring:将 Hertz 和 Go 运行时指标导出到 Prometheus,并使用 Grafana 展示。
  • opentelemetry:对 Hertz 到 Kitex 的请求进行链路追踪,通过 OpenTelemetry Collector 导出数据,并在 Jaeger 与 Grafana/VictoriaMetrics 中查看链路和指标。
  • multiple_service:在不同端口运行多个 Hertz 服务。
  • adaptor:将标准库 http.Handler 实现适配到 Hertz 中,并包含 Jade 模板示例。
  • sentinel:在 Hertz 中使用 Sentinel 进行流量控制。
  • reverseproxy:使用 Hertz 反向代理扩展,包含标准代理、TLS、服务发现、响应修改、SSE、中间件和 WebSocket 示例。
  • hlog:使用 Hertz 日志及其日志扩展。
  • trailer:使用 Hertz 读取和写入 HTTP trailer。
  • graphql-go:在 Hertz 服务端处理 GraphQL 请求。

客户端

Hz

  • hz/thrift:使用 hz 和 Thrift IDL 生成服务端代码。
  • hz/protobuf:使用 hz 和 Protobuf IDL 生成服务端代码。
  • hz/hz_client:使用 hz 生成客户端代码。
  • hz/template:使用自定义 hz 模板生成服务端项目。
  • hz/plugin:在 Thrift 和 Protobuf 项目中使用第三方 hz 代码生成插件。
  • hz/struct_reuse:复用 Kitex 生成的 Thrift 结构体作为 Hertz model。

注意

除非示例自己的 README 另有说明,执行示例命令时请以 hertz-examples 仓库根目录为当前目录。

邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号