From 10e31bb49757667c6007c4c8bb7d8f6b591ef9dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=85=89=E6=98=A5?= Date: Mon, 19 Sep 2022 10:10:08 +0800 Subject: [PATCH] - add fun --- api.go | 4 ++++ const.go | 2 +- gin.go | 4 ++++ go.mod | 2 +- go.sum | 4 ++-- vendor/go.dtapp.net/dorm/const.go | 2 +- vendor/go.dtapp.net/dorm/gorm.go | 3 +++ vendor/go.dtapp.net/dorm/mongo.go | 4 ++++ vendor/go.dtapp.net/dorm/redis.go | 3 +++ vendor/modules.txt | 2 +- 10 files changed, 24 insertions(+), 6 deletions(-) diff --git a/api.go b/api.go index a1a9fe6..0020f5b 100644 --- a/api.go +++ b/api.go @@ -10,6 +10,10 @@ import ( "runtime" ) +// ApiClientFun *ApiClient 驱动 +// jsonStatus bool json状态 +type ApiClientFun func() (*ApiClient, bool) + // ApiClient 接口 type ApiClient struct { gormClient *dorm.GormClient // 数据库驱动 diff --git a/const.go b/const.go index db93410..0466551 100644 --- a/const.go +++ b/const.go @@ -1,5 +1,5 @@ package golog const ( - Version = "1.0.79" + Version = "1.0.80" ) diff --git a/gin.go b/gin.go index e651247..a0fe723 100644 --- a/gin.go +++ b/gin.go @@ -17,6 +17,10 @@ import ( "runtime" ) +// GinClientFun *GinClient 驱动 +// jsonStatus bool json状态 +type GinClientFun func() (*GinClient, bool) + // GinClient 框架 type GinClient struct { gormClient *dorm.GormClient // 数据库驱动 diff --git a/go.mod b/go.mod index 263a2c9..4bf465b 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/gin-gonic/gin v1.8.1 github.com/natefinch/lumberjack v2.0.0+incompatible - go.dtapp.net/dorm v1.0.36 + go.dtapp.net/dorm v1.0.37 go.dtapp.net/goip v1.0.34 go.dtapp.net/gorequest v1.0.31 go.dtapp.net/gotime v1.0.5 diff --git a/go.sum b/go.sum index 4ccf6e2..6be34d0 100644 --- a/go.sum +++ b/go.sum @@ -512,8 +512,8 @@ github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= -go.dtapp.net/dorm v1.0.36 h1:3kqdGhZ/oAKr8YMQo9OXAlByGal+uok6Yh33YXmdJtw= -go.dtapp.net/dorm v1.0.36/go.mod h1:z9ksZ4Y0HHH0odjEiG57d90/ZUBM51qXEWJC8fS+dEM= +go.dtapp.net/dorm v1.0.37 h1:EFhTfa1EVV0KASVsg5ZMJjQLpUPBazpHf19l1reOIf0= +go.dtapp.net/dorm v1.0.37/go.mod h1:z9ksZ4Y0HHH0odjEiG57d90/ZUBM51qXEWJC8fS+dEM= go.dtapp.net/goip v1.0.34 h1:aW2CuPpQwcDOJiyx/gHbvrha3/x+poFRpDxsLtO4EVw= go.dtapp.net/goip v1.0.34/go.mod h1:EctL6B8ue/kZKPr+kKZPU6YTTpNhihane9BHHffwo6Q= go.dtapp.net/gorandom v1.0.1 h1:IWfMClh1ECPvyUjlqD7MwLq4mZdUusD1qAwAdsvEJBs= diff --git a/vendor/go.dtapp.net/dorm/const.go b/vendor/go.dtapp.net/dorm/const.go index 6dd6b81..d847672 100644 --- a/vendor/go.dtapp.net/dorm/const.go +++ b/vendor/go.dtapp.net/dorm/const.go @@ -1,3 +1,3 @@ package dorm -const Version = "1.0.36" +const Version = "1.0.37" diff --git a/vendor/go.dtapp.net/dorm/gorm.go b/vendor/go.dtapp.net/dorm/gorm.go index 5a13897..ce126b1 100644 --- a/vendor/go.dtapp.net/dorm/gorm.go +++ b/vendor/go.dtapp.net/dorm/gorm.go @@ -9,6 +9,9 @@ import ( "time" ) +// GormClientFun *GormClient 驱动 +type GormClientFun func() *GormClient + type ConfigGormClient struct { Dns string // 地址 LogStatus bool // 日志 - 状态 diff --git a/vendor/go.dtapp.net/dorm/mongo.go b/vendor/go.dtapp.net/dorm/mongo.go index 1b33b36..b25a2fb 100644 --- a/vendor/go.dtapp.net/dorm/mongo.go +++ b/vendor/go.dtapp.net/dorm/mongo.go @@ -8,6 +8,10 @@ import ( "go.mongodb.org/mongo-driver/mongo/options" ) +// MongoClientFun *MongoClient 驱动 +// databaseName string 库名 +type MongoClientFun func() (*MongoClient, string) + type ConfigMongoClient struct { Dns string // 地址 Opts *options.ClientOptions diff --git a/vendor/go.dtapp.net/dorm/redis.go b/vendor/go.dtapp.net/dorm/redis.go index 6ce6648..41196db 100644 --- a/vendor/go.dtapp.net/dorm/redis.go +++ b/vendor/go.dtapp.net/dorm/redis.go @@ -8,6 +8,9 @@ import ( "time" ) +// RedisClientFun *RedisClient 驱动 +type RedisClientFun func() *RedisClient + type ConfigRedisClient struct { Addr string // 地址 Password string // 密码 diff --git a/vendor/modules.txt b/vendor/modules.txt index c2ae700..ff41911 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -246,7 +246,7 @@ github.com/xdg-go/stringprep # github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a ## explicit; go 1.12 github.com/youmark/pkcs8 -# go.dtapp.net/dorm v1.0.36 +# go.dtapp.net/dorm v1.0.37 ## explicit; go 1.19 go.dtapp.net/dorm # go.dtapp.net/goip v1.0.34