From 9c5442f06d05d4fd17905e91a415a8ce3d5db705 Mon Sep 17 00:00:00 2001 From: weichen Date: Tue, 13 Oct 2026 15:06:47 +0000 Subject: [PATCH] Enable canonical versioned Go module consumption Why: Allow consumers to download an immutable module revision without nested source checkouts or local path replacements. Evidence: SELF package tests and the prior canonical-path rejection are recorded in the Dev dependency-workspace task card; remote consumption is replayed against the committed candidate. Impact: Change the module identity and its Go imports while preserving API behavior. Existing historical submodule revisions remain buildable. Refs: Versioned dependencies U1/U3; feature/dependency-workspace --- PROJECT.md | 2 +- README.md | 2 +- cli/cli.go | 2 +- cli/cli_test.go | 2 +- config/config.go | 6 +++--- config/config_test.go | 4 ++-- conformance/conformance_test.go | 6 +++--- examples/trace/go.mod | 10 +++++----- examples/trace/trace_test.go | 10 +++++----- go.mod | 2 +- main.go | 2 +- server/server.go | 4 ++-- server/store.go | 4 ++-- sink/async.go | 2 +- sink/console.go | 2 +- sink/fanout.go | 2 +- sink/file.go | 2 +- sink/httpbatch.go | 2 +- sink/memory.go | 2 +- sink/sink_test.go | 2 +- slogadapter/slogadapter.go | 2 +- slogadapter/slogadapter_test.go | 4 ++-- 22 files changed, 38 insertions(+), 38 deletions(-) diff --git a/PROJECT.md b/PROJECT.md index 779ef63..8f97311 100644 --- a/PROJECT.md +++ b/PROJECT.md @@ -5,7 +5,7 @@ ## 仓库与操作 - 目标/产品边界:结构化日志库与可独立部署的采集服务。把一次请求的日志和错误码对齐到同一个 `trace_id`。不导入错误码模块。 -- 源码、资产、文档、机器契约位置:模块路径 `logging-system`。包为 `logsys`、`sink`、`redact`、`config`、`slogadapter`、`server`、`cli`、`conformance`、`examples/trace`。配置示例在 `docs/example.json`。 +- 源码、资产、文档、机器契约位置:模块路径 `git-ssh.u1680832.nyat.app/weichen/Logging-System.git`。包为 `logsys`、`sink`、`redact`、`config`、`slogadapter`、`server`、`cli`、`conformance`、`examples/trace`。配置示例在 `docs/example.json`。 - 权威远端、集成基线、受保护分支:`ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Logging-System.git`,基线 `main`。 - 并行共同基线记录位置、合入通知/主动检查方式:Gitea Issue/PR。消费方用自己的 gitlink 固定版本。 - 发布线与批准版本/实际制品查询入口:无独立制品库。`go build -o bin/logctl .` 从当前提交构建。 diff --git a/README.md b/README.md index dc0a84c..139a486 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 跨系统共用的结构化日志库,以及可独立部署的采集服务。目标是把一次请求的运行日志和错误码对齐到同一个 `trace_id` 上,方便事后追溯。 -本仓库是该模块的源码位置。Go 模块路径为 `logging-system`。只依赖标准库,不依赖错误码模块:只要错误实现了 `ErrorCode()` 和 `ErrorFields()`,错误日志会自动带上码和字段。 +本仓库是该模块的源码位置。Go 模块路径为 `git-ssh.u1680832.nyat.app/weichen/Logging-System.git`。只依赖标准库,不依赖错误码模块:只要错误实现了 `ErrorCode()` 和 `ErrorFields()`,错误日志会自动带上码和字段。 ## 分层 diff --git a/cli/cli.go b/cli/cli.go index 7ca88e5..23f5bac 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -13,7 +13,7 @@ import ( "os" "strings" - "logging-system/server" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/server" ) // Main 执行命令行并返回退出码。 diff --git a/cli/cli_test.go b/cli/cli_test.go index 9c262f4..7b5a6b5 100644 --- a/cli/cli_test.go +++ b/cli/cli_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "logging-system/server" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/server" ) func TestQueryCommand(t *testing.T) { diff --git a/config/config.go b/config/config.go index 684f665..8814482 100644 --- a/config/config.go +++ b/config/config.go @@ -8,9 +8,9 @@ import ( "strings" "time" - "logging-system/logsys" - "logging-system/redact" - "logging-system/sink" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/logsys" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/redact" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/sink" ) // Config 是日志系统的全部可配置项。 diff --git a/config/config_test.go b/config/config_test.go index 6f59cad..dd8cad0 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "logging-system/logsys" - "logging-system/sink" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/logsys" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/sink" ) func TestLoadEnvOverridesFile(t *testing.T) { diff --git a/conformance/conformance_test.go b/conformance/conformance_test.go index 202320d..b6fc8d5 100644 --- a/conformance/conformance_test.go +++ b/conformance/conformance_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "logging-system/logsys" - "logging-system/redact" - "logging-system/sink" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/logsys" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/redact" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/sink" ) func TestSyncConcurrentNoLoss(t *testing.T) { diff --git a/examples/trace/go.mod b/examples/trace/go.mod index d932a7c..037ce32 100644 --- a/examples/trace/go.mod +++ b/examples/trace/go.mod @@ -1,12 +1,12 @@ -module logging-system/examples/trace +module git-ssh.u1680832.nyat.app/weichen/Logging-System.git/examples/trace go 1.27 require ( - error-code-system v0.0.0 - logging-system v0.0.0 + git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git v0.0.0 + git-ssh.u1680832.nyat.app/weichen/Logging-System.git v0.0.0 ) -replace error-code-system => ../../../Error-Code-System +replace git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git => ../../../Error-Code-System -replace logging-system => ../.. +replace git-ssh.u1680832.nyat.app/weichen/Logging-System.git => ../.. diff --git a/examples/trace/trace_test.go b/examples/trace/trace_test.go index d51488c..86a1894 100644 --- a/examples/trace/trace_test.go +++ b/examples/trace/trace_test.go @@ -7,11 +7,11 @@ import ( "net/http/httptest" "testing" - "error-code-system/domains" - "error-code-system/errcode" - "error-code-system/httpx" - "logging-system/logsys" - "logging-system/sink" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/domains" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/errcode" + "git-ssh.u1680832.nyat.app/weichen/Error-Code-System.git/httpx" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/logsys" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/sink" ) func TestErrorCodeReachesLogAndHTTP(t *testing.T) { diff --git a/go.mod b/go.mod index ec04037..c49d080 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module logging-system +module git-ssh.u1680832.nyat.app/weichen/Logging-System.git go 1.27 diff --git a/main.go b/main.go index fdb72d8..2b161ba 100644 --- a/main.go +++ b/main.go @@ -3,7 +3,7 @@ package main import ( "os" - "logging-system/cli" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/cli" ) func main() { diff --git a/server/server.go b/server/server.go index dd93673..d1febd0 100644 --- a/server/server.go +++ b/server/server.go @@ -9,8 +9,8 @@ import ( "strconv" "strings" - "logging-system/logsys" - "logging-system/redact" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/logsys" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/redact" ) // DefaultAddr 是 logcollector 的默认监听地址。 diff --git a/server/store.go b/server/store.go index 871f992..eb2af07 100644 --- a/server/store.go +++ b/server/store.go @@ -6,8 +6,8 @@ import ( "os" "sync" - "logging-system/logsys" - "logging-system/redact" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/logsys" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/redact" ) // Record 是带序号的日志,序号即查询游标。 diff --git a/sink/async.go b/sink/async.go index 08048b3..17ff48d 100644 --- a/sink/async.go +++ b/sink/async.go @@ -6,7 +6,7 @@ import ( "sync/atomic" "time" - "logging-system/logsys" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/logsys" ) // ErrClosed 表示出口已经关闭。 diff --git a/sink/console.go b/sink/console.go index 0524645..7a7a7ad 100644 --- a/sink/console.go +++ b/sink/console.go @@ -5,7 +5,7 @@ import ( "os" "sync" - "logging-system/logsys" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/logsys" ) // Console 把日志写到 io.Writer。Format 为 human 或 json,空值按 human。 diff --git a/sink/fanout.go b/sink/fanout.go index 269555a..28dd9f3 100644 --- a/sink/fanout.go +++ b/sink/fanout.go @@ -3,7 +3,7 @@ package sink import ( "errors" - "logging-system/logsys" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/logsys" ) // Fanout 把同一条日志写到多个出口。单个出口失败不影响其他出口。 diff --git a/sink/file.go b/sink/file.go index 74b3e45..7eabd30 100644 --- a/sink/file.go +++ b/sink/file.go @@ -6,7 +6,7 @@ import ( "path/filepath" "sync" - "logging-system/logsys" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/logsys" ) // File 以互斥锁保护的方式追加日志,可选按大小滚动。 diff --git a/sink/httpbatch.go b/sink/httpbatch.go index 71812e1..2657e81 100644 --- a/sink/httpbatch.go +++ b/sink/httpbatch.go @@ -9,7 +9,7 @@ import ( "sync/atomic" "time" - "logging-system/logsys" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/logsys" ) // HTTPBatch 把日志攒批 POST 到采集器。Async 为 false 时在 Write 里同步发送。 diff --git a/sink/memory.go b/sink/memory.go index 12b546f..d57152b 100644 --- a/sink/memory.go +++ b/sink/memory.go @@ -3,7 +3,7 @@ package sink import ( "sync" - "logging-system/logsys" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/logsys" ) // Memory 把日志留在内存里,供测试和进程内订阅前的缓冲。 diff --git a/sink/sink_test.go b/sink/sink_test.go index fcd8586..6199569 100644 --- a/sink/sink_test.go +++ b/sink/sink_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - "logging-system/logsys" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/logsys" ) func entry(i int) logsys.Entry { diff --git a/slogadapter/slogadapter.go b/slogadapter/slogadapter.go index 4f98c92..2a497f7 100644 --- a/slogadapter/slogadapter.go +++ b/slogadapter/slogadapter.go @@ -5,7 +5,7 @@ import ( "context" "log/slog" - "logging-system/logsys" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/logsys" ) // Handler 把 slog 记录写入 logsys。 diff --git a/slogadapter/slogadapter_test.go b/slogadapter/slogadapter_test.go index 27ec7cc..2d5519d 100644 --- a/slogadapter/slogadapter_test.go +++ b/slogadapter/slogadapter_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "logging-system/logsys" - "logging-system/sink" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/logsys" + "git-ssh.u1680832.nyat.app/weichen/Logging-System.git/sink" ) func TestSlogToLogsys(t *testing.T) {