[Go] RSA 私钥加密公钥解密,及和 Java 实现互通 2025-07-17 golang 5433 words 11 mins read golang RSA 私钥加密公钥解密,及和 Java 实现互通。 在golang中使用RSA算法时,一般都是公钥加密,私钥解密,这是一个常见的场景。但是在实际使用中, 往 Read more...
[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...