Compare commits
1 Commits
master
...
feature/sh
Author | SHA1 | Date | |
---|---|---|---|
4d0d526c6d |
16
abstract/shard_strategy.go
Normal file
16
abstract/shard_strategy.go
Normal file
@ -0,0 +1,16 @@
|
||||
// Package abstract ...
|
||||
//
|
||||
// Description : abstract ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2025-06-21 15:20
|
||||
package abstract
|
||||
|
||||
// IShardStrategy 自定义数据分片策略
|
||||
type IShardStrategy interface {
|
||||
// ShardField 按照哪些字段分表
|
||||
ShardField() []string
|
||||
// Calculate 计算分片值
|
||||
Calculate(inputData map[string]any) (int, error)
|
||||
}
|
281
api2sql/execute.go
Normal file
281
api2sql/execute.go
Normal file
@ -0,0 +1,281 @@
|
||||
// Package api2sql ...
|
||||
//
|
||||
// Description : api2sql ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2024-08-21 20:45
|
||||
package api2sql
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.zhangdeman.cn/zhangdeman/consts"
|
||||
"git.zhangdeman.cn/zhangdeman/database"
|
||||
"git.zhangdeman.cn/zhangdeman/database/abstract"
|
||||
"git.zhangdeman.cn/zhangdeman/database/define"
|
||||
"git.zhangdeman.cn/zhangdeman/wrapper"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
var (
|
||||
Exec = &execute{}
|
||||
)
|
||||
|
||||
type execute struct {
|
||||
databaseClientManager abstract.IWrapperClient // 全部数据库管理的实例
|
||||
baseDao database.BaseDao // 基础dao
|
||||
}
|
||||
|
||||
// SetDatabaseClientManager 设置数据库连接管理实例
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 21:06 2024/8/21
|
||||
func (e *execute) SetDatabaseClientManager(databaseClientManager abstract.IWrapperClient) {
|
||||
e.databaseClientManager = databaseClientManager
|
||||
}
|
||||
|
||||
// Run 执行
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 20:48 2024/8/21
|
||||
func (e *execute) Run(ctx context.Context, inputParam *define.Api2SqlParam) (any, error) {
|
||||
if err := e.formatAndValidateInputParam(inputParam); nil != err {
|
||||
return nil, err
|
||||
}
|
||||
if len(inputParam.InputSql) > 0 {
|
||||
// 基于表达式执行
|
||||
return e.Express(ctx, inputParam)
|
||||
}
|
||||
switch inputParam.SqlType {
|
||||
case consts.SqlTypeCount:
|
||||
return e.Count(ctx, inputParam)
|
||||
case consts.SqlTypeDetail:
|
||||
return e.Detail(ctx, inputParam)
|
||||
case consts.SqlTypeList:
|
||||
return e.List(ctx, inputParam)
|
||||
case consts.SqlTypeInsert:
|
||||
return e.Insert(ctx, inputParam)
|
||||
case consts.SqlTypeUpdate:
|
||||
return e.Update(ctx, inputParam)
|
||||
case consts.SqlTypeDelete:
|
||||
return e.Delete(ctx, inputParam)
|
||||
default:
|
||||
return nil, errors.New(inputParam.SqlType + " : sql type is not support")
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// List 列表
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 20:52 2024/8/21
|
||||
func (e *execute) List(ctx context.Context, inputParam *define.Api2SqlParam) (any, error) {
|
||||
var (
|
||||
err error
|
||||
tx *gorm.DB
|
||||
optionList []define.SetOption
|
||||
)
|
||||
if tx, err = e.getTx(ctx, inputParam); nil != err {
|
||||
return nil, err
|
||||
}
|
||||
if optionList, err = e.getOptionList(ctx, inputParam); nil != err {
|
||||
return nil, err
|
||||
}
|
||||
// 动态生成结果解析结构体
|
||||
st := wrapper.NewDynamic()
|
||||
for _, columnConfig := range inputParam.ColumnList {
|
||||
tag := fmt.Sprintf(`gorm:"%v" json:"%v"`, columnConfig.Column, columnConfig.Alias)
|
||||
column := wrapper.String(columnConfig.Column).SnakeCaseToCamel()
|
||||
switch columnConfig.Type {
|
||||
case "int", "int8", "int16", "int32", "int64":
|
||||
st.AddInt(column, tag, "")
|
||||
case "uint", "uint8", "uint16", "uint32", "uint64":
|
||||
st.AddUint(column, tag, "")
|
||||
case "bool":
|
||||
st.AddBool(column, tag, "")
|
||||
case "float":
|
||||
st.AddBool(column, tag, "")
|
||||
case "string":
|
||||
st.AddString(column, tag, "")
|
||||
case "map":
|
||||
st.AddMap(column, tag, "")
|
||||
case "slice":
|
||||
st.AddSlice(column, tag, "")
|
||||
}
|
||||
}
|
||||
val := st.ToStructDefaultSliceValue()
|
||||
if err = e.baseDao.List(tx, &val, optionList...); nil != err {
|
||||
return nil, err
|
||||
}
|
||||
return val, nil
|
||||
}
|
||||
|
||||
// Detail 详情
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 20:52 2024/8/21
|
||||
func (e *execute) Detail(ctx context.Context, inputParam *define.Api2SqlParam) (any, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// Insert 插入
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 20:52 2024/8/21
|
||||
func (e *execute) Insert(ctx context.Context, inputParam *define.Api2SqlParam) (any, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// Update 更新
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 20:52 2024/8/21
|
||||
func (e *execute) Update(ctx context.Context, inputParam *define.Api2SqlParam) (any, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// Count 数量
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 20:52 2024/8/21
|
||||
func (e *execute) Count(ctx context.Context, inputParam *define.Api2SqlParam) (any, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// Delete 删除
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 20:51 2024/8/21
|
||||
func (e *execute) Delete(ctx context.Context, inputParam *define.Api2SqlParam) (any, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// Express 基于表达式执行
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 20:51 2024/8/21
|
||||
func (e *execute) Express(ctx context.Context, inputParam *define.Api2SqlParam) (any, error) {
|
||||
if nil == e.databaseClientManager {
|
||||
return nil, errors.New("database client is nil, please use `SetDatabaseClientManager` set instance")
|
||||
}
|
||||
// 格式化 inputParam
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// formatAndValidateInputParam 格式化并校验输入参数
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 10:38 2024/8/22
|
||||
func (e *execute) formatAndValidateInputParam(inputParam *define.Api2SqlParam) error {
|
||||
if nil == inputParam {
|
||||
return errors.New("inputParam is nil")
|
||||
}
|
||||
if len(inputParam.DatabaseFlag) == 0 {
|
||||
return errors.New("databaseFlag is empty")
|
||||
}
|
||||
if len(inputParam.Table) == 0 {
|
||||
return errors.New("table is empty")
|
||||
}
|
||||
if len(inputParam.SqlType) == 0 {
|
||||
return errors.New("sqlType is empty")
|
||||
}
|
||||
databaseClient, err := e.databaseClientManager.GetDBClient(inputParam.DatabaseFlag)
|
||||
if nil != err {
|
||||
return errors.New(inputParam.DatabaseFlag + " : database client get fail -> " + err.Error())
|
||||
}
|
||||
// 尝试获取表结构, api 转 sql 要求必须开启表结构缓存, 否则无法确定相关数据如何解析
|
||||
if inputParam.TableColumnConfig, err = databaseClient.GetTableFieldList(inputParam.Table); nil != err {
|
||||
return errors.New(inputParam.DatabaseFlag + " : get table field list fail -> " + err.Error())
|
||||
}
|
||||
if len(inputParam.TableColumnConfig) == 0 {
|
||||
return errors.New(inputParam.DatabaseFlag + " : table field list is empty, please enable `CacheDataTableStructureConfig` or `SetTableColumnConfig`")
|
||||
}
|
||||
// 操作字段列表为空
|
||||
if err = e.validateColumn(inputParam); nil != err {
|
||||
return err
|
||||
}
|
||||
// 验证 force no limit
|
||||
if inputParam.ForceNoLimit {
|
||||
inputParam.Limit = 0
|
||||
inputParam.WithCount = false
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// validateColumn 验证表字段相关
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 11:48 2024/8/22
|
||||
func (e *execute) validateColumn(inputParam *define.Api2SqlParam) error {
|
||||
if len(inputParam.ColumnList) == 0 && wrapper.ArrayType[string]([]string{
|
||||
consts.SqlTypeList, consts.SqlTypeDetail,
|
||||
}).Has(inputParam.SqlType) >= 0 {
|
||||
return errors.New("column list is empty")
|
||||
}
|
||||
// 验证字段是否都正确
|
||||
tableColumnTable := make(map[string]bool)
|
||||
for _, itemColumn := range inputParam.TableColumnConfig {
|
||||
tableColumnTable[itemColumn.Column] = true
|
||||
}
|
||||
for _, columnConfig := range inputParam.ColumnList {
|
||||
if !tableColumnTable[columnConfig.Column] {
|
||||
return errors.New(columnConfig.Column + " : input column not found in table column list")
|
||||
}
|
||||
if len(columnConfig.Alias) == 0 {
|
||||
columnConfig.Alias = columnConfig.Column
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// getTx 获取数据库连接
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 12:20 2024/8/23
|
||||
func (e *execute) getTx(ctx context.Context, inputParam *define.Api2SqlParam) (*gorm.DB, error) {
|
||||
if nil != inputParam.Tx {
|
||||
return inputParam.Tx, nil
|
||||
}
|
||||
if inputParam.ForceMaster || // 强制操作主库
|
||||
wrapper.ArrayType[string]([]string{consts.SqlTypeDelete, consts.SqlTypeInsert, consts.SqlTypeUpdate}).Has(inputParam.SqlType) >= 0 { // 写操作
|
||||
return e.databaseClientManager.GetMasterClient(ctx, inputParam.DatabaseFlag)
|
||||
}
|
||||
return e.databaseClientManager.GetSlaveClient(ctx, inputParam.DatabaseFlag)
|
||||
}
|
||||
|
||||
// getOptionList 设置where条件
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 12:31 2024/8/23
|
||||
func (e *execute) getOptionList(ctx context.Context, inputParam *define.Api2SqlParam) ([]define.SetOption, error) {
|
||||
optionList := []define.SetOption{
|
||||
database.WithTable(inputParam.Table),
|
||||
}
|
||||
// 设置 limit offset
|
||||
if !inputParam.ForceNoLimit && inputParam.Limit > 0 {
|
||||
optionList = append(optionList, database.WithLimit(inputParam.Limit, inputParam.Offset))
|
||||
}
|
||||
for _, item := range inputParam.ConditionList {
|
||||
optionFunc, err := database.WithAnyCondition(item.Column, item.Operate, item.Value)
|
||||
if nil != err {
|
||||
return nil, err
|
||||
}
|
||||
optionList = append(optionList, optionFunc)
|
||||
}
|
||||
return optionList, nil
|
||||
}
|
74
api2sql/execute_test.go
Normal file
74
api2sql/execute_test.go
Normal file
@ -0,0 +1,74 @@
|
||||
// Package api2sql ...
|
||||
//
|
||||
// Description : api2sql ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2024-08-23 17:36
|
||||
package api2sql
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"git.zhangdeman.cn/zhangdeman/consts"
|
||||
"git.zhangdeman.cn/zhangdeman/database"
|
||||
"git.zhangdeman.cn/zhangdeman/database/define"
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func Test_execute_Run(t *testing.T) {
|
||||
clientManager := database.NewWrapperClient()
|
||||
if err := clientManager.AddWithConfig("TEST_DATABASE", nil, &define.Database{
|
||||
Master: &define.Driver{
|
||||
DBType: "sqlite3",
|
||||
Host: "/tmp/gateway.db",
|
||||
},
|
||||
Slave: &define.Driver{
|
||||
DBType: "sqlite3",
|
||||
Host: "/tmp/gateway.db",
|
||||
},
|
||||
}, []string{}); nil != err {
|
||||
panic(err.Error())
|
||||
}
|
||||
dbClient, _ := clientManager.GetDBClient("TEST_DATABASE")
|
||||
|
||||
dbClient.SetTableStructure(map[string][]*define.ColumnConfig{
|
||||
"project": []*define.ColumnConfig{
|
||||
&define.ColumnConfig{
|
||||
Column: "flag",
|
||||
Alias: "project_flag",
|
||||
Type: "string",
|
||||
},
|
||||
},
|
||||
})
|
||||
Exec.SetDatabaseClientManager(clientManager)
|
||||
res, err := Exec.List(context.Background(), &define.Api2SqlParam{
|
||||
DatabaseFlag: "TEST_DATABASE",
|
||||
Table: "project",
|
||||
ForceMaster: false,
|
||||
InputSql: "",
|
||||
TableSplitConfig: define.TableSplitConfig{},
|
||||
SqlType: consts.SqlTypeList,
|
||||
ColumnList: []*define.ColumnConfig{
|
||||
&define.ColumnConfig{
|
||||
Column: "flag",
|
||||
Alias: "project_flag",
|
||||
Type: "string",
|
||||
},
|
||||
},
|
||||
Limit: 0,
|
||||
Offset: 0,
|
||||
ForceNoLimit: false,
|
||||
OrderField: "id",
|
||||
OrderRule: "desc",
|
||||
WithCount: false,
|
||||
ConditionList: nil,
|
||||
TableColumnConfig: nil,
|
||||
Tx: nil,
|
||||
})
|
||||
byteData, _ := json.Marshal(res)
|
||||
tt := reflect.TypeOf(res)
|
||||
fmt.Println(tt.String(), res, err, string(byteData))
|
||||
}
|
@ -42,8 +42,8 @@ type CfgFile struct {
|
||||
//
|
||||
// Date : 15:19 2022/6/9
|
||||
type Database struct {
|
||||
Master *Driver `json:"master" yaml:"master" toml:"master" ini:"master"` // 主库配置
|
||||
Slave *Driver `json:"slave" yaml:"slave" toml:"slave" ini:"slave"` // 从库配置
|
||||
Master *Driver `json:"master" yaml:"master"` // 主库配置
|
||||
Slave *Driver `json:"slave" yaml:"slave"` // 从库配置
|
||||
}
|
||||
|
||||
// Driver ...
|
||||
@ -52,15 +52,15 @@ type Database struct {
|
||||
//
|
||||
// Date : 18:44 2022/5/14
|
||||
type Driver struct {
|
||||
DBType string `json:"db_type" yaml:"db_type" toml:"db_type" ini:"db_type"` // 数据库驱动类型
|
||||
Host string `json:"host" yaml:"host" toml:"host" ini:"host"` // 数据库地址
|
||||
Port int `json:"port" yaml:"port" toml:"port" ini:"port"` // 数据库端口
|
||||
Username string `json:"username" yaml:"username" toml:"username" ini:"username"` // 用户名
|
||||
Password string `json:"password" yaml:"password" toml:"password" ini:"password"` // 密码
|
||||
Database string `json:"database" yaml:"database" toml:"database" ini:"database"` // 数据库
|
||||
Charset string `json:"charset" yaml:"charset" toml:"charset" ini:"charset"` // 数据库编码
|
||||
Connection *Connection `json:"connection" yaml:"connection" toml:"connection" ini:"connection"` // 连接配置
|
||||
Timezone string `json:"timezone" yaml:"timezone" toml:"timezone" ini:"timezone"` // 时区
|
||||
DBType string `json:"db_type" yaml:"db_type"` // 数据库驱动类型
|
||||
Host string `json:"host" yaml:"host"` // 数据库地址
|
||||
Port int `json:"port" yaml:"port"` // 数据库端口
|
||||
Username string `json:"username" yaml:"username"` // 用户名
|
||||
Password string `json:"password" yaml:"password"` // 密码
|
||||
Database string `json:"database" yaml:"database"` // 数据库
|
||||
Charset string `json:"charset" yaml:"charset"` // 数据库编码
|
||||
Connection *Connection `json:"connection" yaml:"connection"` // 连接配置
|
||||
Timezone string `json:"timezone" yaml:"timezone"` // 时区
|
||||
}
|
||||
|
||||
// Connection 连接数配置
|
||||
@ -69,8 +69,8 @@ type Driver struct {
|
||||
//
|
||||
// Date : 15:18 2022/6/9
|
||||
type Connection struct {
|
||||
MaxOpen int `json:"max_open" yaml:"max_open" toml:"max_open" ini:"max_open"` // 最大打开连接数
|
||||
MaxIdle int `json:"max_idle" yaml:"max_idle" toml:"max_idle" ini:"max_idle"` // 最大的处理连接数
|
||||
MaxOpen int `json:"max_open" yaml:"max_open"` // 最大打开连接数
|
||||
MaxIdle int `json:"max_idle" yaml:"max_idle"` // 最大的处理连接数
|
||||
}
|
||||
|
||||
// DescTableItem 表结构的描述
|
||||
|
44
go.mod
44
go.mod
@ -5,8 +5,8 @@ go 1.24.1
|
||||
toolchain go1.24.2
|
||||
|
||||
require (
|
||||
git.zhangdeman.cn/zhangdeman/consts v0.0.0-20250916024308-d378e6c57772
|
||||
git.zhangdeman.cn/zhangdeman/logger v0.0.0-20250817142254-a501f79e7894
|
||||
git.zhangdeman.cn/zhangdeman/consts v0.0.0-20250425024726-cc17224cb995
|
||||
git.zhangdeman.cn/zhangdeman/logger v0.0.0-20250427065227-163236205af5
|
||||
git.zhangdeman.cn/zhangdeman/op_type v0.0.0-20240122104027-4928421213c0
|
||||
git.zhangdeman.cn/zhangdeman/serialize v0.0.0-20250504055908-8d68e6106ea9
|
||||
git.zhangdeman.cn/zhangdeman/wrapper v0.0.0-20250321102712-1cbfbe959740
|
||||
@ -15,63 +15,65 @@ require (
|
||||
go.uber.org/zap v1.27.0
|
||||
gorm.io/driver/mysql v1.6.0
|
||||
gorm.io/driver/sqlite v1.6.0
|
||||
gorm.io/gorm v1.31.0
|
||||
gorm.io/gorm v1.30.0
|
||||
)
|
||||
|
||||
require (
|
||||
filippo.io/edwards25519 v1.1.0 // indirect
|
||||
git.zhangdeman.cn/zhangdeman/easylock v0.0.0-20230731062340-983985c12eda // indirect
|
||||
git.zhangdeman.cn/zhangdeman/easymap v0.0.0-20241101082529-28a6c68e38a4 // indirect
|
||||
git.zhangdeman.cn/zhangdeman/network v0.0.0-20250726060351-78810e906bfa // indirect
|
||||
git.zhangdeman.cn/zhangdeman/gin v0.0.0-20250529071316-7a3da3614e07 // indirect
|
||||
git.zhangdeman.cn/zhangdeman/network v0.0.0-20250529151912-0e6bd9e6691d // indirect
|
||||
git.zhangdeman.cn/zhangdeman/trace v0.0.0-20250412104923-c1ecb1bfe8d5 // indirect
|
||||
git.zhangdeman.cn/zhangdeman/util v0.0.0-20240618042405-6ee2c904644e // indirect
|
||||
git.zhangdeman.cn/zhangdeman/websocket v0.0.0-20241125101541-c5ea194c9c1e // indirect
|
||||
github.com/BurntSushi/toml v1.5.0 // indirect
|
||||
github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394 // indirect
|
||||
github.com/bytedance/gopkg v0.1.3 // indirect
|
||||
github.com/bytedance/sonic v1.14.1 // indirect
|
||||
github.com/bytedance/sonic/loader v0.3.0 // indirect
|
||||
github.com/cloudwego/base64x v0.1.6 // indirect
|
||||
github.com/bytedance/sonic v1.13.3 // indirect
|
||||
github.com/bytedance/sonic/loader v0.2.4 // indirect
|
||||
github.com/cloudwego/base64x v0.1.5 // indirect
|
||||
github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.10 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.9 // indirect
|
||||
github.com/gin-contrib/sse v1.1.0 // indirect
|
||||
github.com/gin-gonic/gin v1.10.1 // indirect
|
||||
github.com/go-ini/ini v1.67.0 // indirect
|
||||
github.com/go-playground/locales v0.14.1 // indirect
|
||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||
github.com/go-playground/validator/v10 v10.27.0 // indirect
|
||||
github.com/go-playground/validator/v10 v10.26.0 // indirect
|
||||
github.com/go-sql-driver/mysql v1.9.3 // indirect
|
||||
github.com/goccy/go-json v0.10.5 // indirect
|
||||
github.com/gorilla/websocket v1.5.3 // indirect
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/jinzhu/now v1.1.5 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
|
||||
github.com/leodido/go-urn v1.4.0 // indirect
|
||||
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible // indirect
|
||||
github.com/lestrrat-go/strftime v1.1.1 // indirect
|
||||
github.com/lestrrat-go/strftime v1.1.0 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mattn/go-sqlite3 v1.14.32 // indirect
|
||||
github.com/mattn/go-sqlite3 v1.14.28 // indirect
|
||||
github.com/mcuadros/go-defaults v1.2.0 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/mozillazg/go-pinyin v0.21.0 // indirect
|
||||
github.com/mozillazg/go-pinyin v0.20.0 // indirect
|
||||
github.com/mssola/user_agent v0.6.0 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
|
||||
github.com/sbabiv/xml2map v1.2.1 // indirect
|
||||
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
||||
github.com/tidwall/gjson v1.18.0 // indirect
|
||||
github.com/tidwall/match v1.2.0 // indirect
|
||||
github.com/tidwall/match v1.1.1 // indirect
|
||||
github.com/tidwall/pretty v1.2.1 // indirect
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||
github.com/ugorji/go/codec v1.3.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
golang.org/x/arch v0.21.0 // indirect
|
||||
golang.org/x/crypto v0.42.0 // indirect
|
||||
golang.org/x/net v0.44.0 // indirect
|
||||
golang.org/x/sys v0.36.0 // indirect
|
||||
golang.org/x/text v0.29.0 // indirect
|
||||
golang.org/x/arch v0.18.0 // indirect
|
||||
golang.org/x/crypto v0.39.0 // indirect
|
||||
golang.org/x/net v0.41.0 // indirect
|
||||
golang.org/x/sys v0.33.0 // indirect
|
||||
golang.org/x/text v0.26.0 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
|
||||
google.golang.org/protobuf v1.36.9 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
gopkg.in/olahol/melody.v1 v1.0.0-20170518105555-d52139073376 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
196
go.sum
196
go.sum
@ -1,46 +1,93 @@
|
||||
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
||||
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
||||
git.zhangdeman.cn/zhangdeman/consts v0.0.0-20250916024308-d378e6c57772 h1:Yo1ur3LnDF5s7F7tpJsNrdUSF8LwYKnN9TdQU32F3eU=
|
||||
git.zhangdeman.cn/zhangdeman/consts v0.0.0-20250916024308-d378e6c57772/go.mod h1:5p8CEKGBxi7qPtTXDI3HDmqKAfIm5i/aBWdrbkbdNjc=
|
||||
git.zhangdeman.cn/zhangdeman/consts v0.0.0-20250215141718-8232f587a6ea h1:6b9bfq44ewsXGVOkyZ+DQ4dNaKtmNsdHOFQxHUdEQrY=
|
||||
git.zhangdeman.cn/zhangdeman/consts v0.0.0-20250215141718-8232f587a6ea/go.mod h1:IXXaZkb7vGzGnGM5RRWrASAuwrVSNxuoe0DmeXx5g6k=
|
||||
git.zhangdeman.cn/zhangdeman/consts v0.0.0-20250227040546-863c03f34bb8 h1:VEifPc+vkpEQoX9rj7zxmT1m+IA81XjOxe7+Z1aqWNM=
|
||||
git.zhangdeman.cn/zhangdeman/consts v0.0.0-20250227040546-863c03f34bb8/go.mod h1:IXXaZkb7vGzGnGM5RRWrASAuwrVSNxuoe0DmeXx5g6k=
|
||||
git.zhangdeman.cn/zhangdeman/consts v0.0.0-20250420101447-0b570213d5c7 h1:dmZ/mwRQ/AGlKXYWyk4Ci+KRiMcJwZii7nUCj2F2bpM=
|
||||
git.zhangdeman.cn/zhangdeman/consts v0.0.0-20250420101447-0b570213d5c7/go.mod h1:5p8CEKGBxi7qPtTXDI3HDmqKAfIm5i/aBWdrbkbdNjc=
|
||||
git.zhangdeman.cn/zhangdeman/consts v0.0.0-20250425024726-cc17224cb995 h1:LmPRAf0AsxRVFPibdpZR89ajlsz8hof2IvMMyTqiEq4=
|
||||
git.zhangdeman.cn/zhangdeman/consts v0.0.0-20250425024726-cc17224cb995/go.mod h1:5p8CEKGBxi7qPtTXDI3HDmqKAfIm5i/aBWdrbkbdNjc=
|
||||
git.zhangdeman.cn/zhangdeman/easylock v0.0.0-20230731062340-983985c12eda h1:bMD6r9gjRy7cO+T4zRQVYAesgIblBdTnhzT1vN5wjvI=
|
||||
git.zhangdeman.cn/zhangdeman/easylock v0.0.0-20230731062340-983985c12eda/go.mod h1:dT0rmHcJ9Z9IqWeMIt7YzR88nKkNV2V3dfG0j9Q6lK0=
|
||||
git.zhangdeman.cn/zhangdeman/easymap v0.0.0-20241101082529-28a6c68e38a4 h1:s6d4b6yY+NaK1AzoBD1pxqsuygEHQz0Oie86c45geDw=
|
||||
git.zhangdeman.cn/zhangdeman/easymap v0.0.0-20241101082529-28a6c68e38a4/go.mod h1:V4Dfg1v/JVIZGEKCm6/aehs8hK+Xow1dkL1yiQymXlQ=
|
||||
git.zhangdeman.cn/zhangdeman/logger v0.0.0-20250817142254-a501f79e7894 h1:7nT1CADIAO2lhikqM1lAFlwrJXa7gNaz5bcUB+LgAIE=
|
||||
git.zhangdeman.cn/zhangdeman/logger v0.0.0-20250817142254-a501f79e7894/go.mod h1:UKGSNWsDmf6pBrC3SuC+jR7/Lj30c6b72hZi8dI+Vp8=
|
||||
git.zhangdeman.cn/zhangdeman/network v0.0.0-20250726060351-78810e906bfa h1:r3AK2EKbQ82ShC5+AjbE95sqm90CkpbzLpmoV3zok9Q=
|
||||
git.zhangdeman.cn/zhangdeman/network v0.0.0-20250726060351-78810e906bfa/go.mod h1:v0tMMfXvE4WyUxaRo1r/D20BAbMkT5QPLSW7XtgQOxo=
|
||||
git.zhangdeman.cn/zhangdeman/gin v0.0.0-20250225092214-3432087fbd07 h1:SadUKF3SZhuRTXaCKyQWEavN9fVLNbHL/GBz/KoiL6o=
|
||||
git.zhangdeman.cn/zhangdeman/gin v0.0.0-20250225092214-3432087fbd07/go.mod h1:T2Q8Wcq98yTuSSaEPZVAZfs0DMSxeXMN10GOQCha5g4=
|
||||
git.zhangdeman.cn/zhangdeman/gin v0.0.0-20250228104311-2fd9195b77e7 h1:koL8c0do1mOLFY+wLMqSpojgHSwVRbV6sSsJVKo9WfA=
|
||||
git.zhangdeman.cn/zhangdeman/gin v0.0.0-20250228104311-2fd9195b77e7/go.mod h1:T2Q8Wcq98yTuSSaEPZVAZfs0DMSxeXMN10GOQCha5g4=
|
||||
git.zhangdeman.cn/zhangdeman/gin v0.0.0-20250413074621-24f33309b9d8 h1:8Wt/SSVJSBR8/nddY+YYERTExc0DHrmShkk6GFUdWzw=
|
||||
git.zhangdeman.cn/zhangdeman/gin v0.0.0-20250413074621-24f33309b9d8/go.mod h1:HRY0KP893Oo1TZLPKv3XhAIhnMdtIipiylNsmJfZzD4=
|
||||
git.zhangdeman.cn/zhangdeman/gin v0.0.0-20250529071316-7a3da3614e07 h1:WTPPj5o/jsweVOUduA8PMDNNNS95cI2w483MEzg5//I=
|
||||
git.zhangdeman.cn/zhangdeman/gin v0.0.0-20250529071316-7a3da3614e07/go.mod h1:vnT78cHvj/fIx6KLNuUOvJrSJy/nckgqK+vRsc9zHD0=
|
||||
git.zhangdeman.cn/zhangdeman/logger v0.0.0-20250224140241-afda8c14a6d1 h1:CvtW010Fy9K84vslJ97zHGKdeh/w2lZzUqgpPXiyw0g=
|
||||
git.zhangdeman.cn/zhangdeman/logger v0.0.0-20250224140241-afda8c14a6d1/go.mod h1:ERUkpRvsn/LQFgyf9A9UCllTV2dSwnyJKWADw23NYTI=
|
||||
git.zhangdeman.cn/zhangdeman/logger v0.0.0-20250228081747-6ab4dff6a19d h1:kj8JhXRr67bFkZ9kRXFicDm6usy7fq9tz8zEBP8xRbM=
|
||||
git.zhangdeman.cn/zhangdeman/logger v0.0.0-20250228081747-6ab4dff6a19d/go.mod h1:HkinIO0tsK5mINroFZ3Qbsmh2V/DaEBtNWiX3+6DIzM=
|
||||
git.zhangdeman.cn/zhangdeman/logger v0.0.0-20250305064240-fee53ce64dc9 h1:HifwSBUtAxrKppYOZfKXI+iEtcTHh2+/zVeNsrIPN+M=
|
||||
git.zhangdeman.cn/zhangdeman/logger v0.0.0-20250305064240-fee53ce64dc9/go.mod h1:0QtFBqrH3FDygCcsgsP/bK5lHSq0qpAulU9HyxtG1pM=
|
||||
git.zhangdeman.cn/zhangdeman/logger v0.0.0-20250427065227-163236205af5 h1:e3N+ODeTBwBOQ4iIzXm9gO3X6Htgc/YmPBImSk7o2mw=
|
||||
git.zhangdeman.cn/zhangdeman/logger v0.0.0-20250427065227-163236205af5/go.mod h1:lTxYyi7IodBefXSdSZwPFs3Izggg5Wxa2RkHlFVwKLg=
|
||||
git.zhangdeman.cn/zhangdeman/network v0.0.0-20250224022106-1c57dcf5afd9 h1:MphPBVuufQt4O2Nm+A2ldG/dMmb0LXZwAGcE/OkTRoU=
|
||||
git.zhangdeman.cn/zhangdeman/network v0.0.0-20250224022106-1c57dcf5afd9/go.mod h1:vSHUJdlbSVDheL+e7KtdG3n/fgb26J/JOMVuEiXG+A8=
|
||||
git.zhangdeman.cn/zhangdeman/network v0.0.0-20250417104342-5592e0a45c32 h1:/ygkDt5WIL7iEBzOVAcxLCFiT9ajE1lGIQDcDNtvNx0=
|
||||
git.zhangdeman.cn/zhangdeman/network v0.0.0-20250417104342-5592e0a45c32/go.mod h1:LKktkiO4at2XvPh/i9VPuT17DxLbBcDHUGMdrRSHNO4=
|
||||
git.zhangdeman.cn/zhangdeman/network v0.0.0-20250529151912-0e6bd9e6691d h1:LnsfdKrInzynhoLNMu83wmfVLbGUmGYAPIJqdG6qRfA=
|
||||
git.zhangdeman.cn/zhangdeman/network v0.0.0-20250529151912-0e6bd9e6691d/go.mod h1:uRg3BnUimmrJiv8N61P6Ir4Im2EqxXZe62m4WBw3sec=
|
||||
git.zhangdeman.cn/zhangdeman/op_type v0.0.0-20240122104027-4928421213c0 h1:gUDlQMuJ4xNfP2Abl1Msmpa3fASLWYkNlqDFF/6GN0Y=
|
||||
git.zhangdeman.cn/zhangdeman/op_type v0.0.0-20240122104027-4928421213c0/go.mod h1:VHb9qmhaPDAQDcS6vUiDCamYjZ4R5lD1XtVsh55KsMI=
|
||||
git.zhangdeman.cn/zhangdeman/serialize v0.0.0-20241223084948-de2e49144fcd h1:q7GG14qgXKB4MEXQFOe7/UYebsqMfPaSX80TcPdOosI=
|
||||
git.zhangdeman.cn/zhangdeman/serialize v0.0.0-20241223084948-de2e49144fcd/go.mod h1:+D6uPSljwHywjVY5WSBY4TRVMj26TN5f5cFGEYMldjs=
|
||||
git.zhangdeman.cn/zhangdeman/serialize v0.0.0-20250504055908-8d68e6106ea9 h1:/GLQaFoLb+ciHOtAS2BIyPNnf4O5ME3AC5PUaJY9kfs=
|
||||
git.zhangdeman.cn/zhangdeman/serialize v0.0.0-20250504055908-8d68e6106ea9/go.mod h1:ABJ655C5QenQNOzf7LjCe4sSB52CXvaWLX2Zg4uwDJY=
|
||||
git.zhangdeman.cn/zhangdeman/trace v0.0.0-20250412104923-c1ecb1bfe8d5 h1:dD1Q/MIrRmIhKqfYPH+y167ca9CKwTPuQt3c1hXWGJ8=
|
||||
git.zhangdeman.cn/zhangdeman/trace v0.0.0-20250412104923-c1ecb1bfe8d5/go.mod h1:PB486NC82nuvn5yi+U2i48ogX/9EAETWAHd8O9TwY9k=
|
||||
git.zhangdeman.cn/zhangdeman/util v0.0.0-20240618042405-6ee2c904644e h1:Q973S6CcWr1ICZhFI1STFOJ+KUImCl2BaIXm6YppBqI=
|
||||
git.zhangdeman.cn/zhangdeman/util v0.0.0-20240618042405-6ee2c904644e/go.mod h1:VpPjBlwz8U+OxZuxzHQBv1aEEZ3pStH6bZvT21ADEbI=
|
||||
git.zhangdeman.cn/zhangdeman/websocket v0.0.0-20241125101541-c5ea194c9c1e h1:YE2Gi+M03UDImIpWa3I7jzSesyfu2RL8x/4ONs5v0oE=
|
||||
git.zhangdeman.cn/zhangdeman/websocket v0.0.0-20241125101541-c5ea194c9c1e/go.mod h1:L/7JugxKZL3JP9JP/XDvPAPz0FQXG1u181Su1+u/d1c=
|
||||
git.zhangdeman.cn/zhangdeman/wrapper v0.0.0-20250124091620-c757e551a8c9 h1:yF770WIDNwyiKL0nwmBGmjZvNCLXtHQL4xJyffPjTMU=
|
||||
git.zhangdeman.cn/zhangdeman/wrapper v0.0.0-20250124091620-c757e551a8c9/go.mod h1:I76wxEsWq7KnMQ84elpwTjEqq4I49QFw60tp5h7iGBs=
|
||||
git.zhangdeman.cn/zhangdeman/wrapper v0.0.0-20250321102712-1cbfbe959740 h1:zPUoylfJTbc0EcxW+NEzOTBmoeFZ2I/rLFBnEzxb4Wk=
|
||||
git.zhangdeman.cn/zhangdeman/wrapper v0.0.0-20250321102712-1cbfbe959740/go.mod h1:1ct92dbVc49pmXusA/iGfcQUJzcYmJ+cjAhgc3sDv1I=
|
||||
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
|
||||
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
|
||||
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||
github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394 h1:OYA+5W64v3OgClL+IrOD63t4i/RW7RqrAVl9LTZ9UqQ=
|
||||
github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394/go.mod h1:Q8n74mJTIgjX4RBBcHnJ05h//6/k6foqmgE45jTQtxg=
|
||||
github.com/bytedance/gopkg v0.1.3 h1:TPBSwH8RsouGCBcMBktLt1AymVo2TVsBVCY4b6TnZ/M=
|
||||
github.com/bytedance/gopkg v0.1.3/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM=
|
||||
github.com/bytedance/sonic v1.14.1 h1:FBMC0zVz5XUmE4z9wF4Jey0An5FueFvOsTKKKtwIl7w=
|
||||
github.com/bytedance/sonic v1.14.1/go.mod h1:gi6uhQLMbTdeP0muCnrjHLeCUPyb70ujhnNlhOylAFc=
|
||||
github.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=
|
||||
github.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=
|
||||
github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=
|
||||
github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=
|
||||
github.com/bytedance/sonic v1.12.9 h1:Od1BvK55NnewtGaJsTDeAOSnLVO2BTSLOe0+ooKokmQ=
|
||||
github.com/bytedance/sonic v1.12.9/go.mod h1:uVvFidNmlt9+wa31S1urfwwthTWteBgG0hWuoKAXTx8=
|
||||
github.com/bytedance/sonic v1.12.10 h1:uVCQr6oS5669E9ZVW0HyksTLfNS7Q/9hV6IVS4nEMsI=
|
||||
github.com/bytedance/sonic v1.12.10/go.mod h1:uVvFidNmlt9+wa31S1urfwwthTWteBgG0hWuoKAXTx8=
|
||||
github.com/bytedance/sonic v1.13.2 h1:8/H1FempDZqC4VqjptGo14QQlJx8VdZJegxs6wwfqpQ=
|
||||
github.com/bytedance/sonic v1.13.2/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4=
|
||||
github.com/bytedance/sonic v1.13.3 h1:MS8gmaH16Gtirygw7jV91pDCN33NyMrPbN7qiYhEsF0=
|
||||
github.com/bytedance/sonic v1.13.3/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4=
|
||||
github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
|
||||
github.com/bytedance/sonic/loader v0.2.3 h1:yctD0Q3v2NOGfSWPLPvG2ggA2kV6TS6s4wioyEqssH0=
|
||||
github.com/bytedance/sonic/loader v0.2.3/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=
|
||||
github.com/bytedance/sonic/loader v0.2.4 h1:ZWCw4stuXUsn1/+zQDqeE7JKP+QO47tz7QCNan80NzY=
|
||||
github.com/bytedance/sonic/loader v0.2.4/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=
|
||||
github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4=
|
||||
github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w=
|
||||
github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
|
||||
github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 h1:CaO/zOnF8VvUfEbhRatPcwKVWamvbYd8tQGRWacE9kU=
|
||||
github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4=
|
||||
github.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=
|
||||
github.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
|
||||
github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM=
|
||||
github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8=
|
||||
github.com/gabriel-vasile/mimetype v1.4.9 h1:5k+WDwEsD9eTLL8Tz3L0VnmVh9QxGjRmjBvAG7U/oYY=
|
||||
github.com/gabriel-vasile/mimetype v1.4.9/go.mod h1:WnSQhFKJuBlRyLiKohA/2DtIlPFAbguNaG7QCHcyGok=
|
||||
github.com/gin-contrib/sse v1.0.0 h1:y3bT1mUWUxDpW4JLQg/HnTqV4rozuW4tC9eFKTxYI9E=
|
||||
github.com/gin-contrib/sse v1.0.0/go.mod h1:zNuFdwarAygJBht0NTKiSi3jRf6RbqeILZ9Sp6Slhe0=
|
||||
github.com/gin-contrib/sse v1.1.0 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w=
|
||||
github.com/gin-contrib/sse v1.1.0/go.mod h1:hxRZ5gVpWMT7Z0B0gSNYqqsSCNIJMjzvm6fqCz9vjwM=
|
||||
github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU=
|
||||
github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y=
|
||||
github.com/gin-gonic/gin v1.10.1 h1:T0ujvqyCSqRopADpgPgiTT63DUQVSfojyME59Ei63pQ=
|
||||
github.com/gin-gonic/gin v1.10.1/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y=
|
||||
github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A=
|
||||
@ -51,19 +98,24 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o
|
||||
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
||||
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
||||
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
||||
github.com/go-playground/validator/v10 v10.27.0 h1:w8+XrWVMhGkxOaaowyKH35gFydVHOvC0/uWoy2Fzwn4=
|
||||
github.com/go-playground/validator/v10 v10.27.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo=
|
||||
github.com/go-playground/validator/v10 v10.25.0 h1:5Dh7cjvzR7BRZadnsVOzPhWsrwUr0nmsZJxEAnFLNO8=
|
||||
github.com/go-playground/validator/v10 v10.25.0/go.mod h1:GGzBIJMuE98Ic/kJsBXbz1x/7cByt++cQ+YOuDM5wus=
|
||||
github.com/go-playground/validator/v10 v10.26.0 h1:SP05Nqhjcvz81uJaRfEV0YBSSSGMc/iMaVtFbr3Sw2k=
|
||||
github.com/go-playground/validator/v10 v10.26.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo=
|
||||
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
||||
github.com/go-sql-driver/mysql v1.9.0 h1:Y0zIbQXhQKmQgTp44Y1dp3wTXcn804QoTptLZT1vtvo=
|
||||
github.com/go-sql-driver/mysql v1.9.0/go.mod h1:pDetrLJeA3oMujJuvXc8RJoasr589B6A9fwzD3QMrqw=
|
||||
github.com/go-sql-driver/mysql v1.9.2 h1:4cNKDYQ1I84SXslGddlsrMhc8k4LeDVj6Ad6WRjiHuU=
|
||||
github.com/go-sql-driver/mysql v1.9.2/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU=
|
||||
github.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo=
|
||||
github.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU=
|
||||
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
|
||||
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
|
||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
||||
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g=
|
||||
github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k=
|
||||
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
||||
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
||||
@ -74,10 +126,12 @@ github.com/jonboulle/clockwork v0.3.0 h1:9BSCMi8C+0qdApAp4auwX0RkLGUjs956h0EkuQy
|
||||
github.com/jonboulle/clockwork v0.3.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
|
||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=
|
||||
github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
|
||||
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||
github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE=
|
||||
github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
|
||||
github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
|
||||
@ -86,25 +140,33 @@ github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2t
|
||||
github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is=
|
||||
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible h1:Y6sqxHMyB1D2YSzWkLibYKgg+SwmyFU9dF2hn6MdTj4=
|
||||
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible/go.mod h1:ZQnN8lSECaebrkQytbHj4xNgtg8CR7RYXnPok8e0EHA=
|
||||
github.com/lestrrat-go/strftime v1.1.1 h1:zgf8QCsgj27GlKBy3SU9/8MMgegZ8UCzlCyHYrUF0QU=
|
||||
github.com/lestrrat-go/strftime v1.1.1/go.mod h1:YDrzHJAODYQ+xxvrn5SG01uFIQAeDTzpxNVppCz7Nmw=
|
||||
github.com/lestrrat-go/strftime v1.1.0 h1:gMESpZy44/4pXLO/m+sL0yBd1W6LjgjrrD4a68Gapyg=
|
||||
github.com/lestrrat-go/strftime v1.1.0/go.mod h1:uzeIB52CeUJenCo1syghlugshMysrqUT51HlxphXVeI=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-sqlite3 v1.14.32 h1:JD12Ag3oLy1zQA+BNn74xRgaBbdhbNIDYvQUEuuErjs=
|
||||
github.com/mattn/go-sqlite3 v1.14.32/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/mattn/go-sqlite3 v1.14.24 h1:tpSp2G2KyMnnQu99ngJ47EIkWVmliIizyZBfPrBWDRM=
|
||||
github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/mattn/go-sqlite3 v1.14.28 h1:ThEiQrnbtumT+QMknw63Befp/ce/nUPgBPMlRFEum7A=
|
||||
github.com/mattn/go-sqlite3 v1.14.28/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/mcuadros/go-defaults v1.2.0 h1:FODb8WSf0uGaY8elWJAkoLL0Ri6AlZ1bFlenk56oZtc=
|
||||
github.com/mcuadros/go-defaults v1.2.0/go.mod h1:WEZtHEVIGYVDqkKSWBdWKUVdRyKlMfulPaGDWIVeCWY=
|
||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/mozillazg/go-pinyin v0.21.0 h1:Wo8/NT45z7P3er/9YSLHA3/kjZzbLz5hR7i+jGeIGao=
|
||||
github.com/mozillazg/go-pinyin v0.21.0/go.mod h1:iR4EnMMRXkfpFVV5FMi4FNB6wGq9NV6uDWbUuPhP4Yc=
|
||||
github.com/mozillazg/go-pinyin v0.20.0 h1:BtR3DsxpApHfKReaPO1fCqF4pThRwH9uwvXzm+GnMFQ=
|
||||
github.com/mozillazg/go-pinyin v0.20.0/go.mod h1:iR4EnMMRXkfpFVV5FMi4FNB6wGq9NV6uDWbUuPhP4Yc=
|
||||
github.com/mssola/user_agent v0.6.0 h1:uwPR4rtWlCHRFyyP9u2KOV0u8iQXmS7Z7feTrstQwk4=
|
||||
github.com/mssola/user_agent v0.6.0/go.mod h1:TTPno8LPY3wAIEKRpAtkdMT0f8SE24pLRGPahjCH4uw=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=
|
||||
github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc=
|
||||
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
|
||||
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
@ -113,31 +175,31 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/sbabiv/xml2map v1.2.1 h1:1lT7t0hhUvXZCkdxqtq4n8/ZCnwLWGq4rDuDv5XOoFE=
|
||||
github.com/sbabiv/xml2map v1.2.1/go.mod h1:2TPoAfcaM7+Sd4iriPvzyntb2mx7GY+kkQpB/GQa/eo=
|
||||
github.com/smarty/assertions v1.15.0 h1:cR//PqUBUiQRakZWqBiFFQ9wb8emQGDb0HeGdqGByCY=
|
||||
github.com/smarty/assertions v1.15.0/go.mod h1:yABtdzeQs6l1brC900WlRNwj6ZR55d7B+E8C6HtKdec=
|
||||
github.com/smartystreets/goconvey v1.8.1 h1:qGjIddxOk4grTu9JPOU31tVfq3cNdBlNa5sSznIX1xY=
|
||||
github.com/smartystreets/goconvey v1.8.1/go.mod h1:+/u4qLyY6x1jReYOp7GOM2FSt8aP9CzCZL03bI28W60=
|
||||
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
|
||||
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
|
||||
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
|
||||
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
|
||||
github.com/tidwall/match v1.2.0 h1:0pt8FlkOwjN2fPt4bIl4BoNxb98gGHN2ObFEDkrfZnM=
|
||||
github.com/tidwall/match v1.2.0/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
|
||||
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
|
||||
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
|
||||
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
|
||||
github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE=
|
||||
github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
|
||||
github.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=
|
||||
github.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=
|
||||
github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2 h1:zzrxE1FKn5ryBNl9eKOeqQ58Y/Qpo3Q9QNxKHX5uzzQ=
|
||||
@ -148,22 +210,44 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
|
||||
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
|
||||
golang.org/x/arch v0.21.0 h1:iTC9o7+wP6cPWpDWkivCvQFGAHDQ59SrSxsLPcnkArw=
|
||||
golang.org/x/arch v0.21.0/go.mod h1:dNHoOeKiyja7GTvF9NJS1l3Z2yntpQNzgrjh1cU103A=
|
||||
golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI=
|
||||
golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8=
|
||||
golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I=
|
||||
golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY=
|
||||
golang.org/x/arch v0.14.0 h1:z9JUEZWr8x4rR0OU6c4/4t6E6jOZ8/QBS2bBYBm4tx4=
|
||||
golang.org/x/arch v0.14.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
|
||||
golang.org/x/arch v0.16.0 h1:foMtLTdyOmIniqWCHjY6+JxuC54XP1fDwx4N0ASyW+U=
|
||||
golang.org/x/arch v0.16.0/go.mod h1:JmwW7aLIoRUKgaTzhkiEFxvcEiQGyOg9BMonBJUS7EE=
|
||||
golang.org/x/arch v0.18.0 h1:WN9poc33zL4AzGxqf8VtpKUnGvMi8O9lhNyBMF/85qc=
|
||||
golang.org/x/arch v0.18.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=
|
||||
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
|
||||
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
|
||||
golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE=
|
||||
golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc=
|
||||
golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
|
||||
golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
|
||||
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
|
||||
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
|
||||
golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY=
|
||||
golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E=
|
||||
golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw=
|
||||
golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
|
||||
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk=
|
||||
golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=
|
||||
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
|
||||
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
|
||||
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
|
||||
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
|
||||
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
|
||||
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
|
||||
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
|
||||
golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
|
||||
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
|
||||
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
|
||||
google.golang.org/protobuf v1.36.9 h1:w2gp2mA27hUeUzj9Ex9FBjsBm40zfaDtEWow293U7Iw=
|
||||
google.golang.org/protobuf v1.36.9/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
|
||||
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
|
||||
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
@ -172,9 +256,17 @@ gopkg.in/olahol/melody.v1 v1.0.0-20170518105555-d52139073376/go.mod h1:BHKOc1m5w
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gorm.io/driver/mysql v1.5.7 h1:MndhOPYOfEp2rHKgkZIhJ16eVUIRf2HmzgoPmh7FCWo=
|
||||
gorm.io/driver/mysql v1.5.7/go.mod h1:sEtPWMiqiN1N1cMXoXmBbd8C6/l+TESwriotuRRpkDM=
|
||||
gorm.io/driver/mysql v1.6.0 h1:eNbLmNTpPpTOVZi8MMxCi2aaIm0ZpInbORNXDwyLGvg=
|
||||
gorm.io/driver/mysql v1.6.0/go.mod h1:D/oCC2GWK3M/dqoLxnOlaNKmXz8WNTfcS9y5ovaSqKo=
|
||||
gorm.io/driver/sqlite v1.5.7 h1:8NvsrhP0ifM7LX9G4zPB97NwovUakUxc+2V2uuf3Z1I=
|
||||
gorm.io/driver/sqlite v1.5.7/go.mod h1:U+J8craQU6Fzkcvu8oLeAQmi50TkwPEhHDEjQZXDah4=
|
||||
gorm.io/driver/sqlite v1.6.0 h1:WHRRrIiulaPiPFmDcod6prc4l2VGVWHz80KspNsxSfQ=
|
||||
gorm.io/driver/sqlite v1.6.0/go.mod h1:AO9V1qIQddBESngQUKWL9yoH93HIeA1X6V633rBwyT8=
|
||||
gorm.io/gorm v1.31.0 h1:0VlycGreVhK7RF/Bwt51Fk8v0xLiiiFdbGDPIZQ7mJY=
|
||||
gorm.io/gorm v1.31.0/go.mod h1:XyQVbO2k6YkOis7C2437jSit3SsDK72s7n7rsSHd+Gs=
|
||||
gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
|
||||
gorm.io/gorm v1.25.12 h1:I0u8i2hWQItBq1WfE0o2+WuL9+8L21K9e2HHSTE/0f8=
|
||||
gorm.io/gorm v1.25.12/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ=
|
||||
gorm.io/gorm v1.30.0 h1:qbT5aPv1UH8gI99OsRlvDToLxW5zR7FzS9acZDOZcgs=
|
||||
gorm.io/gorm v1.30.0/go.mod h1:8Z33v652h4//uMA76KjeDH8mJXPm1QNCYrMeatR0DOE=
|
||||
nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=
|
||||
|
@ -7,50 +7,47 @@
|
||||
// Date : 2021-10-25 4:50 下午
|
||||
package sql2go
|
||||
|
||||
import "git.zhangdeman.cn/zhangdeman/consts"
|
||||
|
||||
// sqlTypeMap mysql数据类型 => go 数据类型映射
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 4:50 下午 2021/10/25
|
||||
var sqlTypeMap = map[string]string{
|
||||
"int": consts.DataTypeInt.String(),
|
||||
"integer": consts.DataTypeInt.String(),
|
||||
"tinyint": consts.DataTypeInt8.String(),
|
||||
"smallint": consts.DataTypeInt16.String(),
|
||||
"mediumint": consts.DataTypeInt32.String(),
|
||||
"bigint": consts.DataTypeInt64.String(),
|
||||
"int unsigned": consts.DataTypeUint.String(),
|
||||
"integer unsigned": consts.DataTypeUint.String(),
|
||||
"tinyint unsigned": consts.DataTypeUint8.String(),
|
||||
"smallint unsigned": consts.DataTypeUint16.String(),
|
||||
"mediumint unsigned": consts.DataTypeUint32.String(),
|
||||
"bigint unsigned": consts.DataTypeUint64.String(),
|
||||
"int": "int",
|
||||
"integer": "int",
|
||||
"tinyint": "int8",
|
||||
"smallint": "int16",
|
||||
"mediumint": "int32",
|
||||
"bigint": "int64",
|
||||
"int unsigned": "uint",
|
||||
"integer unsigned": "uint",
|
||||
"tinyint unsigned": "uint8",
|
||||
"smallint unsigned": "uint16",
|
||||
"mediumint unsigned": "uint32",
|
||||
"bigint unsigned": "uint64",
|
||||
"bit": "byte",
|
||||
"bool": consts.DataTypeBool.String(),
|
||||
"enum": consts.DataTypeString.String(),
|
||||
"set": consts.DataTypeString.String(),
|
||||
"varchar": consts.DataTypeString.String(),
|
||||
"char": consts.DataTypeString.String(),
|
||||
"tinytext": consts.DataTypeString.String(),
|
||||
"mediumtext": consts.DataTypeString.String(),
|
||||
"text": consts.DataTypeString.String(),
|
||||
"longtext": consts.DataTypeString.String(),
|
||||
"blob": consts.DataTypeString.String(),
|
||||
"tinyblob": consts.DataTypeString.String(),
|
||||
"mediumblob": consts.DataTypeString.String(),
|
||||
"longblob": consts.DataTypeString.String(),
|
||||
"bool": "bool",
|
||||
"enum": "string",
|
||||
"set": "string",
|
||||
"varchar": "string",
|
||||
"char": "string",
|
||||
"tinytext": "string",
|
||||
"mediumtext": "string",
|
||||
"text": "string",
|
||||
"longtext": "string",
|
||||
"blob": "string",
|
||||
"tinyblob": "string",
|
||||
"mediumblob": "string",
|
||||
"longblob": "string",
|
||||
"date": "time.Time",
|
||||
"datetime": "time.Time",
|
||||
"timestamp": "time.Time",
|
||||
"time": "time.Time",
|
||||
"float": consts.DataTypeFloat64.String(),
|
||||
"double": consts.DataTypeFloat64.String(),
|
||||
"decimal": consts.DataTypeFloat64.String(),
|
||||
"binary": consts.DataTypeString.String(),
|
||||
"varbinary": consts.DataTypeString.String(),
|
||||
"json": consts.DataTypeString.String(),
|
||||
"float": "float64",
|
||||
"double": "float64",
|
||||
"decimal": "float64",
|
||||
"binary": "string",
|
||||
"varbinary": "string",
|
||||
}
|
||||
|
||||
const (
|
||||
|
@ -9,16 +9,15 @@ package sql2go
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
wrapperType "git.zhangdeman.cn/zhangdeman/wrapper"
|
||||
"strings"
|
||||
|
||||
"github.com/xwb1989/sqlparser"
|
||||
)
|
||||
|
||||
const (
|
||||
// CreateSQLColumnTPL 每个字段的模版
|
||||
CreateSQLColumnTPL = " {FIELD} {TYPE} `json:\"{JSON_TAG}\" gorm:\"column:{COLUMN};default:{DEFAULT_VALUE};{NOT_NULL}\" dc:\"{COMMENT}\"`"
|
||||
CreateSQLColumnTPL = " {FIELD} {TYPE} `json:\"{JSON_TAG}\" gorm:\"column:{COLUMN};default:{DEFAULT_VALUE};{NOT_NULL}\"` // {COMMENT}"
|
||||
// TableColumnTpl 每个字段的模版
|
||||
TableColumnTpl = " {FIELD} string `json:\"{JSON_TAG}\"`"
|
||||
// TableColumnDescTpl 字段描述
|
||||
@ -94,14 +93,11 @@ func generateTable(tableName string, modelStructName string, columnList []*sqlpa
|
||||
|
||||
for _, item := range columnList {
|
||||
comment := ""
|
||||
if item.Type.Comment == nil || item.Type.Comment.Val == nil {
|
||||
if item.Type.Comment == nil {
|
||||
comment = item.Name.String()
|
||||
} else {
|
||||
comment = string(item.Type.Comment.Val)
|
||||
}
|
||||
if comment == "" {
|
||||
comment = item.Name.String()
|
||||
}
|
||||
data := map[string]string{
|
||||
"{FIELD}": wrapperType.String(item.Name.String()).SnakeCaseToCamel(),
|
||||
"{COLUMN}": item.Name.String(),
|
||||
@ -110,10 +106,6 @@ func generateTable(tableName string, modelStructName string, columnList []*sqlpa
|
||||
"{COMMENT}": comment,
|
||||
"{TYPE}": sqlTypeMap[item.Type.Type],
|
||||
}
|
||||
if item.Type.Unsigned {
|
||||
// 无符号
|
||||
data["{TYPE}"] = sqlTypeMap[item.Type.Type+" unsigned"]
|
||||
}
|
||||
/*if data["{FIELD}"] == "ID" {
|
||||
basic.PrimaryFieldType = data["{TYPE}"]
|
||||
}*/
|
||||
@ -158,20 +150,17 @@ return "{{TABLE_NAME}}"
|
||||
func generateTableColumnDefined(modelStructName string, columnList []*sqlparser.ColumnDefinition) (string, string, string) {
|
||||
columnDefineName := modelStructName + "Column"
|
||||
structFieldResult := "type " + columnDefineName + " struct { \n"
|
||||
structFieldDescInstanceResult := columnDefineName + "{ \n"
|
||||
structFieldDescInstanceResult := "&" + columnDefineName + "{ \n"
|
||||
structFieldCommentInstanceResult := "map[string]string{ \n"
|
||||
for _, column := range columnList {
|
||||
comment := column.Name.String()
|
||||
if nil != column.Type.Comment {
|
||||
comment = string(column.Type.Comment.Val)
|
||||
}
|
||||
if comment == "" {
|
||||
comment = column.Name.String()
|
||||
}
|
||||
dataMap := map[string]string{
|
||||
"{FIELD}": wrapperType.String(column.Name.String()).SnakeCaseToCamel(),
|
||||
"{JSON_TAG}": column.Name.String(),
|
||||
"{FIELD_COMMENT}": comment,
|
||||
"{FIELD_COMMENT}": wrapperType.TernaryOperator.String(
|
||||
column.Type.Comment == nil,
|
||||
wrapperType.String(column.Name.String()),
|
||||
wrapperType.String(string(column.Type.Comment.Val)),
|
||||
).Value(),
|
||||
}
|
||||
|
||||
structFieldDefine := TableColumnTpl
|
||||
@ -192,7 +181,7 @@ func generateTableColumnDefined(modelStructName string, columnList []*sqlparser.
|
||||
tableColumnFunction := `
|
||||
|
||||
// Columns 获取表字段定义
|
||||
func ({TABLE_FIRST} {MODEL_STRUCT_NAME}) Columns() {COLUMN_DEFINED} {
|
||||
func ({TABLE_FIRST} {MODEL_STRUCT_NAME}) Columns() *{COLUMN_DEFINED} {
|
||||
return {STRUCT_FIELD_DESC_DEFINED_RESULT}
|
||||
}
|
||||
|
||||
|
@ -11,15 +11,14 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"git.zhangdeman.cn/zhangdeman/consts"
|
||||
"git.zhangdeman.cn/zhangdeman/database/abstract"
|
||||
"git.zhangdeman.cn/zhangdeman/database/define"
|
||||
"git.zhangdeman.cn/zhangdeman/serialize"
|
||||
"go.uber.org/zap"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
@ -33,7 +32,7 @@ func init() {
|
||||
WrapperClient = NewWrapperClient()
|
||||
}
|
||||
|
||||
func NewWrapperClient() abstract.IWrapperClient {
|
||||
func NewWrapperClient() *wrapperClient {
|
||||
return &wrapperClient{
|
||||
lock: &sync.RWMutex{},
|
||||
clientTable: make(map[string]abstract.IWrapperDatabaseClient),
|
||||
|
Reference in New Issue
Block a user