Skip to content

Commit 16b646b

Browse files
committed
refactor: replace cmux with connmux and add upgrade command
1 parent 97e0ec5 commit 16b646b

89 files changed

Lines changed: 6262 additions & 1394 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ kdata
2525
*.log
2626
proto-vendor
2727
.gitconfig
28+
.local

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ Funk is a comprehensive Go utility library that provides enhanced error handling
5252
- Path and file utilities
5353
- String and formatting helpers
5454

55+
### 🔀 Connection Multiplexing
56+
- Serve gRPC/HTTP/1/HTTP/2 on the same port (connection sniffing)
57+
- Package: `connmux` (see `connmux/README.md`)
58+
5559
## Installation
5660

5761
```bash

README.zh.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ Funk是一个全面的Go实用程序库,提供增强的错误处理、结果
5252
- 路径和文件实用程序
5353
- 字符串和格式化助手
5454

55+
### 🔀 连接分流(同端口多协议)
56+
- 在同一个端口上同时提供 gRPC / HTTP/1 / HTTP/2(通过连接 sniff)
57+
- 包:`connmux`(见 `connmux/README.md`
58+
5559
## 安装
5660

5761
```bash

closer/utils.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,22 @@ import (
55
"log/slog"
66
)
77

8+
func ErrClose(closer func() error) {
9+
if closer == nil {
10+
return
11+
}
12+
13+
if err := closer(); err != nil {
14+
slog.Error("failed to close error operation", "err", err)
15+
}
16+
}
17+
818
func SafeClose(closer io.Closer) {
919
if closer == nil {
1020
return
1121
}
1222

1323
if err := closer.Close(); err != nil {
14-
slog.Error("failed to close operation", "err", err)
24+
slog.Error("failed to close io operation", "err", err)
1525
}
1626
}

cmds/configcmd/cmd.go

Lines changed: 0 additions & 32 deletions
This file was deleted.

cmds/ent/main1.go

Lines changed: 0 additions & 171 deletions
This file was deleted.

cmds/envcmd/cmd.go

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)