[Go] 新一代官方标准日志库 slog 将日志按级别写入到不同文件 2025-06-22 golang 1267 words 3 mins read log/slog 是 Go 1.21 引入的一个新的日志记录包 slog相较于传统log包,slog提供了更丰富的功能,如:支持结构化日志,能输出json等格式的日志, 同时 Read more...
在使用Cloudflare的情况下,如何在Nginx中获取到真实的客户端IP地址呢? 2025-06-14 nginx cloudflare 1478 words 3 mins read 在使用Cloudflare的情况下,如何在后端Nginx中获取到真实的客户端IP地址呢? Cloudflare作为代理服务,它的作用是让用户的 Read more...
[唐诗] 《山中送别》 2025-05-25 中文 111 words 1 min read 《山中送别》唐·王维 山中相送罢,日暮掩柴扉。 春草年年绿,王孙归不归。 “春草年年绿,王孙归不归?”后两句翻用《楚辞》语意,原文“王孙游兮不归, Read more...
[Go] Golang 实现 Server Sent Events Demo 2025-05-18 golang 1102 words 3 mins read 以下是一个完整的 Server-Sent Events (SSE) 在 Go 中的实现示例,包含服务端和客户端的代码。SSE 适用于服务器向客户端单向推送实时数据的场景(如通知、日志流等)。 Server-Sent Events Read more...
[Go] go-zero 使用入门 2025-05-18 golang 795 words 2 mins read go-zero快速开始 go-zero 是一个集成了各种工程实践的 web 和 rpc 框架。 架构图 框架设计 轻松获得支撑千万日活服务的稳定性,内建级联超时控制、限流、自适 Read more...