chore(module): 更新仓库地址及模块导入路径
Verify / verify (push) Canceled after 0s
Verify / verify (pull_request) Canceled after 0s

This commit is contained in:
zhangdeman committed 2026-11-27 22:58:26 -08:00
1 parent 44e21e1322
commit 52205b42c8
39 files changed
+81 -81

No files matched your search

+3 -3
View File
@@ -2,8 +2,8 @@
围绕 Gin、GORM/MySQL、Zap、go-redis 和原生 HTTP Client 的独立 Go 基础库。统一请求处理、配置、诊断和资源生命周期,业务认证、审计和供应商策略由消费应用负责。 围绕 Gin、GORM/MySQL、Zap、go-redis 和原生 HTTP Client 的独立 Go 基础库。统一请求处理、配置、诊断和资源生命周期,业务认证、审计和供应商策略由消费应用负责。
- 源码:[git.zhangdeman.cn/github/ginframework](https://git.zhangdeman.cn/github/ginframework) - 源码:[git.zhangdeman.cn/zhangdeman/ginframework](https://git.zhangdeman.cn/zhangdeman/ginframework)
- Module:`git.zhangdeman.cn/github/ginframework` - Module:`git.zhangdeman.cn/zhangdeman/ginframework`
- 工具链:Go 1.27.0;当前尚未发布版本 tag。 - 工具链:Go 1.27.0;当前尚未发布版本 tag。
## 接入使用 ## 接入使用
@@ -11,7 +11,7 @@
**[接入使用指南](docs/getting-started.md)** 是统一能力清单和使用入口,覆盖安装、最小服务、参数绑定、认证适配、日志、MySQL、Redis、出站 HTTP、SSE 和退出顺序。新增、移除及改变能力须同步该指南,公开包清单纳入 make verify。 **[接入使用指南](docs/getting-started.md)** 是统一能力清单和使用入口,覆盖安装、最小服务、参数绑定、认证适配、日志、MySQL、Redis、出站 HTTP、SSE 和退出顺序。新增、移除及改变能力须同步该指南,公开包清单纳入 make verify。
```sh ```sh
go get git.zhangdeman.cn/github/ginframework@codex/initial-framework go get git.zhangdeman.cn/zhangdeman/ginframework@codex/initial-framework
``` ```
检出本仓库后运行最小 HTTP 示例: 检出本仓库后运行最小 HTTP 示例:
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"os" "os"
"reflect" "reflect"
fault "git.zhangdeman.cn/github/ginframework/internal/failure" fault "git.zhangdeman.cn/zhangdeman/ginframework/internal/failure"
"github.com/goccy/go-yaml" "github.com/goccy/go-yaml"
) )
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"path/filepath" "path/filepath"
"testing" "testing"
"git.zhangdeman.cn/github/ginframework/fault" "git.zhangdeman.cn/zhangdeman/ginframework/fault"
) )
func TestStrictEnvironmentAndOptionalValues(t *testing.T) { func TestStrictEnvironmentAndOptionalValues(t *testing.T) {
+2 -2
View File
@@ -9,8 +9,8 @@ import (
"strconv" "strconv"
"time" "time"
"git.zhangdeman.cn/github/ginframework/database/sqllog" "git.zhangdeman.cn/zhangdeman/ginframework/database/sqllog"
fault "git.zhangdeman.cn/github/ginframework/internal/failure" fault "git.zhangdeman.cn/zhangdeman/ginframework/internal/failure"
mysqlDriver "github.com/go-sql-driver/mysql" mysqlDriver "github.com/go-sql-driver/mysql"
"go.uber.org/zap" "go.uber.org/zap"
"gorm.io/driver/mysql" "gorm.io/driver/mysql"
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"errors" "errors"
"testing" "testing"
"git.zhangdeman.cn/github/ginframework/fault" "git.zhangdeman.cn/zhangdeman/ginframework/fault"
"gorm.io/driver/sqlite" "gorm.io/driver/sqlite"
"gorm.io/gorm" "gorm.io/gorm"
) )
+2 -2
View File
@@ -8,9 +8,9 @@ import (
"strings" "strings"
"time" "time"
"git.zhangdeman.cn/github/ginframework/logger/storagevalue" "git.zhangdeman.cn/zhangdeman/ginframework/logger/storagevalue"
"git.zhangdeman.cn/github/ginframework/diagnostic" "git.zhangdeman.cn/zhangdeman/ginframework/diagnostic"
"go.uber.org/zap" "go.uber.org/zap"
"gorm.io/gorm" "gorm.io/gorm"
gormLogger "gorm.io/gorm/logger" gormLogger "gorm.io/gorm/logger"
+3 -3
View File
@@ -4,12 +4,12 @@
## 1. 安装与版本 ## 1. 安装与版本
源码仓库:[github/ginframework](https://git.zhangdeman.cn/github/ginframework)。Go module 与源码地址一致:`git.zhangdeman.cn/github/ginframework`。 源码仓库:[zhangdeman/ginframework](https://git.zhangdeman.cn/zhangdeman/ginframework)。仓库由 `github/ginframework` 迁移至 `zhangdeman/ginframework`,已有消费项目需同步替换旧 module 依赖及全部导入路径;本库不提供旧路径兼容层。Go module 与源码地址一致:`git.zhangdeman.cn/zhangdeman/ginframework`。
当前需要 Go 1.27.0。库尚未发布版本 tag;首次接入使用初始开发分支,Go 会将分支解析为固定伪版本写入消费项目的 go.mod: 当前需要 Go 1.27.0。库尚未发布版本 tag;首次接入使用初始开发分支,Go 会将分支解析为固定伪版本写入消费项目的 go.mod:
```sh ```sh
go get git.zhangdeman.cn/github/ginframework@codex/initial-framework go get git.zhangdeman.cn/zhangdeman/ginframework@codex/initial-framework
go mod tidy go mod tidy
``` ```
@@ -73,7 +73,7 @@ func (*Example) Ping(ctx *gin.Context, form *PingForm) (*PingOutput, error) {
} }
``` ```
其中 `framework` 是 `git.zhangdeman.cn/github/ginframework/http` 的导入别名,`gin` 是 `github.com/gin-gonic/gin`。启动函数中装配: 其中 `framework` 是 `git.zhangdeman.cn/zhangdeman/ginframework/http` 的导入别名,`gin` 是 `github.com/gin-gonic/gin`。启动函数中装配:
```go ```go
server, err := framework.NewServer(framework.Config{ server, err := framework.NewServer(framework.Config{
+7 -7
View File
@@ -11,13 +11,13 @@ import (
"syscall" "syscall"
"time" "time"
"git.zhangdeman.cn/github/ginframework/config" "git.zhangdeman.cn/zhangdeman/ginframework/config"
"git.zhangdeman.cn/github/ginframework/database" "git.zhangdeman.cn/zhangdeman/ginframework/database"
"git.zhangdeman.cn/github/ginframework/fault" "git.zhangdeman.cn/zhangdeman/ginframework/fault"
framework "git.zhangdeman.cn/github/ginframework/http" framework "git.zhangdeman.cn/zhangdeman/ginframework/http"
"git.zhangdeman.cn/github/ginframework/httpclient" "git.zhangdeman.cn/zhangdeman/ginframework/httpclient"
"git.zhangdeman.cn/github/ginframework/logger" "git.zhangdeman.cn/zhangdeman/ginframework/logger"
cache "git.zhangdeman.cn/github/ginframework/redis" cache "git.zhangdeman.cn/zhangdeman/ginframework/redis"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
redisclient "github.com/redis/go-redis/v9" redisclient "github.com/redis/go-redis/v9"
) )
+4 -4
View File
@@ -8,10 +8,10 @@ import (
"testing" "testing"
"time" "time"
"git.zhangdeman.cn/github/ginframework/database" "git.zhangdeman.cn/zhangdeman/ginframework/database"
"git.zhangdeman.cn/github/ginframework/httpclient" "git.zhangdeman.cn/zhangdeman/ginframework/httpclient"
"git.zhangdeman.cn/github/ginframework/logger" "git.zhangdeman.cn/zhangdeman/ginframework/logger"
cache "git.zhangdeman.cn/github/ginframework/redis" cache "git.zhangdeman.cn/zhangdeman/ginframework/redis"
redisclient "github.com/redis/go-redis/v9" redisclient "github.com/redis/go-redis/v9"
"gorm.io/driver/sqlite" "gorm.io/driver/sqlite"
) )
+2 -2
View File
@@ -9,8 +9,8 @@ import (
"syscall" "syscall"
"time" "time"
framework "git.zhangdeman.cn/github/ginframework/http" framework "git.zhangdeman.cn/zhangdeman/ginframework/http"
"git.zhangdeman.cn/github/ginframework/logger" "git.zhangdeman.cn/zhangdeman/ginframework/logger"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
+3 -3
View File
@@ -6,9 +6,9 @@ import (
"flag" "flag"
"os" "os"
"git.zhangdeman.cn/github/ginframework/fault" "git.zhangdeman.cn/zhangdeman/ginframework/fault"
framework "git.zhangdeman.cn/github/ginframework/http" framework "git.zhangdeman.cn/zhangdeman/ginframework/http"
"git.zhangdeman.cn/github/ginframework/logger" "git.zhangdeman.cn/zhangdeman/ginframework/logger"
"github.com/getkin/kin-openapi/openapi3" "github.com/getkin/kin-openapi/openapi3"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
+1 -1
View File
@@ -1,4 +1,4 @@
module git.zhangdeman.cn/github/ginframework module git.zhangdeman.cn/zhangdeman/ginframework
go 1.27.0 go 1.27.0
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"errors" "errors"
"net/http" "net/http"
failure "git.zhangdeman.cn/github/ginframework/internal/failure" failure "git.zhangdeman.cn/zhangdeman/ginframework/internal/failure"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
+6 -6
View File
@@ -12,12 +12,12 @@ import (
"strings" "strings"
"testing" "testing"
"git.zhangdeman.cn/github/ginframework/database" "git.zhangdeman.cn/zhangdeman/ginframework/database"
"git.zhangdeman.cn/github/ginframework/diagnostic" "git.zhangdeman.cn/zhangdeman/ginframework/diagnostic"
"git.zhangdeman.cn/github/ginframework/httpclient" "git.zhangdeman.cn/zhangdeman/ginframework/httpclient"
"git.zhangdeman.cn/github/ginframework/internal/testutil/redisserver" "git.zhangdeman.cn/zhangdeman/ginframework/internal/testutil/redisserver"
"git.zhangdeman.cn/github/ginframework/logger" "git.zhangdeman.cn/zhangdeman/ginframework/logger"
"git.zhangdeman.cn/github/ginframework/redis/commandlog" "git.zhangdeman.cn/zhangdeman/ginframework/redis/commandlog"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
redisclient "github.com/redis/go-redis/v9" redisclient "github.com/redis/go-redis/v9"
"go.uber.org/zap" "go.uber.org/zap"
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"strings" "strings"
"time" "time"
failure "git.zhangdeman.cn/github/ginframework/internal/failure" failure "git.zhangdeman.cn/zhangdeman/ginframework/internal/failure"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
+2 -2
View File
@@ -9,8 +9,8 @@ import (
"reflect" "reflect"
"strings" "strings"
"git.zhangdeman.cn/github/ginframework/http/request" "git.zhangdeman.cn/zhangdeman/ginframework/http/request"
failure "git.zhangdeman.cn/github/ginframework/internal/failure" failure "git.zhangdeman.cn/zhangdeman/ginframework/internal/failure"
"github.com/getkin/kin-openapi/openapi3" "github.com/getkin/kin-openapi/openapi3"
) )
+3 -3
View File
@@ -12,9 +12,9 @@ import (
"testing" "testing"
"time" "time"
"git.zhangdeman.cn/github/ginframework/diagnostic" "git.zhangdeman.cn/zhangdeman/ginframework/diagnostic"
"git.zhangdeman.cn/github/ginframework/http/request" "git.zhangdeman.cn/zhangdeman/ginframework/http/request"
"git.zhangdeman.cn/github/ginframework/logger" "git.zhangdeman.cn/zhangdeman/ginframework/logger"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/go-playground/validator/v10" "github.com/go-playground/validator/v10"
) )
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"io" "io"
"net/http" "net/http"
fault "git.zhangdeman.cn/github/ginframework/internal/failure" fault "git.zhangdeman.cn/zhangdeman/ginframework/internal/failure"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
+1 -1
View File
@@ -14,7 +14,7 @@ import (
"reflect" "reflect"
"strings" "strings"
fault "git.zhangdeman.cn/github/ginframework/internal/failure" fault "git.zhangdeman.cn/zhangdeman/ginframework/internal/failure"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding" "github.com/gin-gonic/gin/binding"
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"strings" "strings"
"sync" "sync"
fault "git.zhangdeman.cn/github/ginframework/internal/failure" fault "git.zhangdeman.cn/zhangdeman/ginframework/internal/failure"
"github.com/gin-gonic/gin/binding" "github.com/gin-gonic/gin/binding"
"github.com/go-playground/validator/v10" "github.com/go-playground/validator/v10"
) )
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"regexp" "regexp"
"strings" "strings"
failure "git.zhangdeman.cn/github/ginframework/internal/failure" failure "git.zhangdeman.cn/zhangdeman/ginframework/internal/failure"
"github.com/go-playground/validator/v10" "github.com/go-playground/validator/v10"
) )
+5 -5
View File
@@ -7,11 +7,11 @@ import (
"net/http" "net/http"
"time" "time"
"git.zhangdeman.cn/github/ginframework/diagnostic" "git.zhangdeman.cn/zhangdeman/ginframework/diagnostic"
"git.zhangdeman.cn/github/ginframework/fault" "git.zhangdeman.cn/zhangdeman/ginframework/fault"
"git.zhangdeman.cn/github/ginframework/http/request" "git.zhangdeman.cn/zhangdeman/ginframework/http/request"
failure "git.zhangdeman.cn/github/ginframework/internal/failure" failure "git.zhangdeman.cn/zhangdeman/ginframework/internal/failure"
"git.zhangdeman.cn/github/ginframework/logger" "git.zhangdeman.cn/zhangdeman/ginframework/logger"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
+2 -2
View File
@@ -11,8 +11,8 @@ import (
"strings" "strings"
"time" "time"
"git.zhangdeman.cn/github/ginframework/http/request" "git.zhangdeman.cn/zhangdeman/ginframework/http/request"
failure "git.zhangdeman.cn/github/ginframework/internal/failure" failure "git.zhangdeman.cn/zhangdeman/ginframework/internal/failure"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/mcuadros/go-defaults" "github.com/mcuadros/go-defaults"
) )
+4 -4
View File
@@ -10,10 +10,10 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"git.zhangdeman.cn/github/ginframework/diagnostic" "git.zhangdeman.cn/zhangdeman/ginframework/diagnostic"
"git.zhangdeman.cn/github/ginframework/fault" "git.zhangdeman.cn/zhangdeman/ginframework/fault"
failure "git.zhangdeman.cn/github/ginframework/internal/failure" failure "git.zhangdeman.cn/zhangdeman/ginframework/internal/failure"
"git.zhangdeman.cn/github/ginframework/logger" "git.zhangdeman.cn/zhangdeman/ginframework/logger"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/google/uuid" "github.com/google/uuid"
"go.uber.org/zap" "go.uber.org/zap"
+1 -1
View File
@@ -11,7 +11,7 @@ import (
"testing" "testing"
"time" "time"
"git.zhangdeman.cn/github/ginframework/diagnostic" "git.zhangdeman.cn/zhangdeman/ginframework/diagnostic"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
+2 -2
View File
@@ -7,8 +7,8 @@ import (
"net/http" "net/http"
"time" "time"
"git.zhangdeman.cn/github/ginframework/diagnostic" "git.zhangdeman.cn/zhangdeman/ginframework/diagnostic"
failure "git.zhangdeman.cn/github/ginframework/internal/failure" failure "git.zhangdeman.cn/zhangdeman/ginframework/internal/failure"
"go.uber.org/zap" "go.uber.org/zap"
) )
+2 -2
View File
@@ -19,8 +19,8 @@ import (
"testing" "testing"
"time" "time"
"git.zhangdeman.cn/github/ginframework/diagnostic" "git.zhangdeman.cn/zhangdeman/ginframework/diagnostic"
"git.zhangdeman.cn/github/ginframework/fault" "git.zhangdeman.cn/zhangdeman/ginframework/fault"
"go.uber.org/zap" "go.uber.org/zap"
"go.uber.org/zap/zaptest/observer" "go.uber.org/zap/zaptest/observer"
) )
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
"git.zhangdeman.cn/github/ginframework/httpclient" "git.zhangdeman.cn/zhangdeman/ginframework/httpclient"
) )
func ExampleClient_Send() { func ExampleClient_Send() {
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"sort" "sort"
"strings" "strings"
failure "git.zhangdeman.cn/github/ginframework/internal/failure" failure "git.zhangdeman.cn/zhangdeman/ginframework/internal/failure"
) )
// File 是已有内存内容的上传文件,不在编码阶段打开文件或启动后台协程。 // File 是已有内存内容的上传文件,不在编码阶段打开文件或启动后台协程。
+2 -2
View File
@@ -11,8 +11,8 @@ import (
"strings" "strings"
"time" "time"
"git.zhangdeman.cn/github/ginframework/diagnostic" "git.zhangdeman.cn/zhangdeman/ginframework/diagnostic"
failure "git.zhangdeman.cn/github/ginframework/internal/failure" failure "git.zhangdeman.cn/zhangdeman/ginframework/internal/failure"
) )
// Request 描述单次请求,不保存跨请求的可变参数或供应商成功规则。 // Request 描述单次请求,不保存跨请求的可变参数或供应商成功规则。
+2 -2
View File
@@ -4,8 +4,8 @@ package failure
import ( import (
"context" "context"
"git.zhangdeman.cn/github/ginframework/fault" "git.zhangdeman.cn/zhangdeman/ginframework/fault"
"git.zhangdeman.cn/github/ginframework/logger" "git.zhangdeman.cn/zhangdeman/ginframework/logger"
) )
// Wrap 在首次接收原始错误时增加场景并记录,已经分类的错误直接传播。 // Wrap 在首次接收原始错误时增加场景并记录,已经分类的错误直接传播。
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"errors" "errors"
"git.zhangdeman.cn/github/ginframework/diagnostic" "git.zhangdeman.cn/zhangdeman/ginframework/diagnostic"
"git.zhangdeman.cn/github/ginframework/fault" "git.zhangdeman.cn/zhangdeman/ginframework/fault"
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"fmt" "fmt"
"os" "os"
"git.zhangdeman.cn/github/ginframework/diagnostic" "git.zhangdeman.cn/zhangdeman/ginframework/diagnostic"
"git.zhangdeman.cn/github/ginframework/logger/storagevalue" "git.zhangdeman.cn/zhangdeman/ginframework/logger/storagevalue"
"go.uber.org/zap" "go.uber.org/zap"
"go.uber.org/zap/zapcore" "go.uber.org/zap/zapcore"
) )
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"reflect" "reflect"
"strings" "strings"
"git.zhangdeman.cn/github/ginframework/diagnostic" "git.zhangdeman.cn/zhangdeman/ginframework/diagnostic"
"go.uber.org/zap" "go.uber.org/zap"
) )
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"errors" "errors"
"time" "time"
fault "git.zhangdeman.cn/github/ginframework/internal/failure" fault "git.zhangdeman.cn/zhangdeman/ginframework/internal/failure"
"git.zhangdeman.cn/github/ginframework/redis/commandlog" "git.zhangdeman.cn/zhangdeman/ginframework/redis/commandlog"
redisclient "github.com/redis/go-redis/v9" redisclient "github.com/redis/go-redis/v9"
"go.uber.org/zap" "go.uber.org/zap"
) )
+2 -2
View File
@@ -7,8 +7,8 @@ import (
"testing" "testing"
"time" "time"
"git.zhangdeman.cn/github/ginframework/fault" "git.zhangdeman.cn/zhangdeman/ginframework/fault"
"git.zhangdeman.cn/github/ginframework/internal/testutil/redisserver" "git.zhangdeman.cn/zhangdeman/ginframework/internal/testutil/redisserver"
) )
func TestOpenNativeClientAndProbeFailure(t *testing.T) { func TestOpenNativeClientAndProbeFailure(t *testing.T) {
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"strings" "strings"
"time" "time"
"git.zhangdeman.cn/github/ginframework/logger/storagevalue" "git.zhangdeman.cn/zhangdeman/ginframework/logger/storagevalue"
"github.com/redis/go-redis/v9" "github.com/redis/go-redis/v9"
"go.uber.org/zap" "go.uber.org/zap"
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"strings" "strings"
"testing" "testing"
"git.zhangdeman.cn/github/ginframework/internal/testutil/redisserver" "git.zhangdeman.cn/zhangdeman/ginframework/internal/testutil/redisserver"
"github.com/redis/go-redis/v9" "github.com/redis/go-redis/v9"
"go.uber.org/zap" "go.uber.org/zap"
+1 -1
View File
@@ -41,7 +41,7 @@ func main() {
// 入参:formatCheck 决定检查格式,architecture 决定检查生产 import。 // 入参:formatCheck 决定检查格式,architecture 决定检查生产 import。
// 返回:第一个解析、格式或架构违规,附文件和必要位置。 // 返回:第一个解析、格式或架构违规,附文件和必要位置。
func run(formatCheck bool, architecture bool) error { func run(formatCheck bool, architecture bool) error {
const module = "git.zhangdeman.cn/github/ginframework" const module = "git.zhangdeman.cn/zhangdeman/ginframework"
return filepath.WalkDir(".", func(path string, entry fs.DirEntry, walkErr error) error { return filepath.WalkDir(".", func(path string, entry fs.DirEntry, walkErr error) error {
if walkErr != nil { if walkErr != nil {
return walkErr return walkErr
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.