From 37f574b436ef019086fcb1e30259c635b990e88c 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:05:55 +0800 Subject: [PATCH] - add fun --- const.go | 2 +- gorm.go | 3 +++ mongo.go | 4 ++++ redis.go | 3 +++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/const.go b/const.go index 6dd6b81..d847672 100644 --- a/const.go +++ b/const.go @@ -1,3 +1,3 @@ package dorm -const Version = "1.0.36" +const Version = "1.0.37" diff --git a/gorm.go b/gorm.go index 5a13897..ce126b1 100644 --- a/gorm.go +++ b/gorm.go @@ -9,6 +9,9 @@ import ( "time" ) +// GormClientFun *GormClient 驱动 +type GormClientFun func() *GormClient + type ConfigGormClient struct { Dns string // 地址 LogStatus bool // 日志 - 状态 diff --git a/mongo.go b/mongo.go index 1b33b36..b25a2fb 100644 --- a/mongo.go +++ b/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/redis.go b/redis.go index 6ce6648..41196db 100644 --- a/redis.go +++ b/redis.go @@ -8,6 +8,9 @@ import ( "time" ) +// RedisClientFun *RedisClient 驱动 +type RedisClientFun func() *RedisClient + type ConfigRedisClient struct { Addr string // 地址 Password string // 密码