diff --git a/client.go b/client.go index 8970f3e..e78ca3c 100644 --- a/client.go +++ b/client.go @@ -81,9 +81,12 @@ func NewClient(config *ClientConfig) (*Client, error) { gormClient := config.GormClientFun() if gormClient != nil && gormClient.Db != nil { - c.log.logGormClient, err = golog.NewApiGormClient(func() (*dorm.GormClient, string) { - return gormClient, logTable - }, config.Debug) + c.log.logGormClient, err = golog.NewApiGormClient(&golog.ApiGormClientConfig{ + GormClientFun: func() (*dorm.GormClient, string) { + return gormClient, logTable + }, + Debug: config.Debug, + }) if err != nil { return nil, err } @@ -93,9 +96,12 @@ func NewClient(config *ClientConfig) (*Client, error) { mongoClient, databaseName := config.MongoClientFun() if mongoClient != nil && mongoClient.Db != nil { - c.log.logMongoClient, err = golog.NewApiMongoClient(func() (*dorm.MongoClient, string, string) { - return mongoClient, databaseName, logTable - }, config.Debug) + c.log.logMongoClient, err = golog.NewApiMongoClient(&golog.ApiMongoClientConfig{ + MongoClientFun: func() (*dorm.MongoClient, string, string) { + return mongoClient, databaseName, logTable + }, + Debug: config.Debug, + }) if err != nil { return nil, err } diff --git a/const.go b/const.go index acc9eb3..af6f9e2 100644 --- a/const.go +++ b/const.go @@ -8,4 +8,4 @@ const ( logTable = "wechatopen" ) -const Version = "1.0.19" +const Version = "1.0.20" diff --git a/go.mod b/go.mod index 97b0f92..5a385be 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/mitchellh/mapstructure v1.5.0 go.dtapp.net/dorm v1.0.30 - go.dtapp.net/golog v1.0.44 + go.dtapp.net/golog v1.0.45 go.dtapp.net/gorequest v1.0.27 ) @@ -57,10 +57,10 @@ require ( github.com/ugorji/go/codec v1.2.7 // indirect github.com/ulikunitz/xz v0.5.10 // indirect github.com/upper/db/v4 v4.5.4 // indirect - github.com/uptrace/bun v1.1.7 // indirect - github.com/uptrace/bun/dialect/mysqldialect v1.1.7 // indirect - github.com/uptrace/bun/dialect/pgdialect v1.1.7 // indirect - github.com/uptrace/bun/driver/pgdriver v1.1.7 // indirect + github.com/uptrace/bun v1.1.8 // indirect + github.com/uptrace/bun/dialect/mysqldialect v1.1.8 // indirect + github.com/uptrace/bun/dialect/pgdialect v1.1.8 // indirect + github.com/uptrace/bun/driver/pgdriver v1.1.8 // indirect github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect @@ -69,7 +69,7 @@ require ( github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect go.dtapp.net/goip v1.0.28 // indirect go.dtapp.net/gorandom v1.0.1 // indirect - go.dtapp.net/gostring v1.0.9 // indirect + go.dtapp.net/gostring v1.0.10 // indirect go.dtapp.net/gotime v1.0.5 // indirect go.dtapp.net/gotrace_id v1.0.6 // indirect go.dtapp.net/gourl v1.0.0 // indirect @@ -78,11 +78,11 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.23.0 // indirect - golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d // indirect + golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b // indirect golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde // indirect - golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64 // indirect + golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index 2496a45..2fa715f 100644 --- a/go.sum +++ b/go.sum @@ -490,14 +490,14 @@ github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/upper/db/v4 v4.5.4 h1:Hxho4jSx4E+3fxlFgdH4wQTRKygtL0YQPDLQPCUu9wg= github.com/upper/db/v4 v4.5.4/go.mod h1:wyu5BM5Y2gowOt4i6C4LbxftH9QeUF338XVGH4uk+Eo= -github.com/uptrace/bun v1.1.7 h1:biOoh5dov69hQPBlaRsXSHoEOIEnCxFzQvUmbscSNJI= -github.com/uptrace/bun v1.1.7/go.mod h1:Z2Pd3cRvNKbrYuL6Gp1XGjA9QEYz+rDz5KkEi9MZLnQ= -github.com/uptrace/bun/dialect/mysqldialect v1.1.7 h1:eMDtsuu5BRuh0P2l0/j0Qv5UBmcqJE0u3F8Zy//klNM= -github.com/uptrace/bun/dialect/mysqldialect v1.1.7/go.mod h1:cCSZH3IULSGaG76Z96mAC7O74MeIYGfDX7CWGanGc0s= -github.com/uptrace/bun/dialect/pgdialect v1.1.7 h1:94GPc8RRC9AVoQ+4KCqRX2zScevsVfOttk13wm60/P8= -github.com/uptrace/bun/dialect/pgdialect v1.1.7/go.mod h1:kKHFmQIyBl0kvQDsoyrlXaKsceTH2TJnbCUFlK9QAmE= -github.com/uptrace/bun/driver/pgdriver v1.1.7 h1:WExzNbsMBWmkjcylV8kKzcbA7pKWZ5UhPflknzUP2PA= -github.com/uptrace/bun/driver/pgdriver v1.1.7/go.mod h1:ZswdiMQOKmY5OBR84YGzaNddbpDo/kkhCzQXm5E2ZqA= +github.com/uptrace/bun v1.1.8 h1:slxuaP4LYWFbPRUmTtQhfJN+6eX/6ar2HDKYTcI50SA= +github.com/uptrace/bun v1.1.8/go.mod h1:iT89ESdV3uMupD9ixt6Khidht+BK0STabK/LeZE+B84= +github.com/uptrace/bun/dialect/mysqldialect v1.1.8 h1:gcL5iy0yUbuJJLkE+0G3vAUS/6GjPLkqFTtN2+tx7XU= +github.com/uptrace/bun/dialect/mysqldialect v1.1.8/go.mod h1:GQdbU4Yk/1qKVxfOieCAOC62ZM1c6qXUpgA1vxckEow= +github.com/uptrace/bun/dialect/pgdialect v1.1.8 h1:wayJhjYDPGv8tgOBLolbBtSFQ0TihFoo8E1T129UdA8= +github.com/uptrace/bun/dialect/pgdialect v1.1.8/go.mod h1:nNbU8PHTjTUM+CRtGmqyBb9zcuRAB8I680/qoFSmBUk= +github.com/uptrace/bun/driver/pgdriver v1.1.8 h1:gyL22axRQfjJS2Umq0erzJnp0bLOdUE8/USKZHPQB8o= +github.com/uptrace/bun/driver/pgdriver v1.1.8/go.mod h1:4tHK0h7a/UoldBoe9J3GU4tEYjr3mkd62U3Kq3PVk3E= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= @@ -521,14 +521,14 @@ go.dtapp.net/dorm v1.0.30 h1:B2gwSe1ov4S+LPUv1ijFm4XE2KEeNn85eCP4WLilsCU= go.dtapp.net/dorm v1.0.30/go.mod h1:7ysGN47mW3u0EDAzXI3oUYZZHA3uasf2spugHeANPW8= go.dtapp.net/goip v1.0.28 h1:wZt+wbzNhOLRUJnepG4c8HhUr4V9jNXOF6wJ1h7jUvU= go.dtapp.net/goip v1.0.28/go.mod h1:ZqPPUvpOSzdtB/dEZFiaD0CBRZmvIzjDmm3XkpMC9Bo= -go.dtapp.net/golog v1.0.44 h1:wGTEcUgIJj/GSqYNiRPYou4FMssyMioAyDmDWcisc74= -go.dtapp.net/golog v1.0.44/go.mod h1:gBfmjjRJOfauahiqhKBoLC6vrk4WpLLrPfJu/+OOgL0= +go.dtapp.net/golog v1.0.45 h1:qfDrzcOfSeOgGlDxCyW+tEViXEhAZFzz6TzNeEWv/o0= +go.dtapp.net/golog v1.0.45/go.mod h1:QHP4MZoUZUtw1/pgBu7V5RIw766g2KrI44W0q6sj/40= go.dtapp.net/gorandom v1.0.1 h1:IWfMClh1ECPvyUjlqD7MwLq4mZdUusD1qAwAdsvEJBs= go.dtapp.net/gorandom v1.0.1/go.mod h1:ZPdgalKpvFV/ATQqR0k4ns/F/IpITAZpx6WkWirr5Y8= go.dtapp.net/gorequest v1.0.27 h1:Hip1mfSZJDNcmE2iZgB3PYa0C/7BAMEJLsCaMd6t9iE= go.dtapp.net/gorequest v1.0.27/go.mod h1:922s7pjYulKIytUMGAYS4aHU6cnzTbOQURGBPCKSxAk= -go.dtapp.net/gostring v1.0.9 h1:ditLXN4Suv0RKwhZBxWBzRHRD1VMJ6w9Dw6RkqYWXm4= -go.dtapp.net/gostring v1.0.9/go.mod h1:L4kREy89a9AraMHB5tUjjl+5rxP1gpXkDouRKKuzT50= +go.dtapp.net/gostring v1.0.10 h1:eG+1kQehdJUitj9Hfwy79SndMHYOB7ABpWkTs7mDGeQ= +go.dtapp.net/gostring v1.0.10/go.mod h1:L4kREy89a9AraMHB5tUjjl+5rxP1gpXkDouRKKuzT50= go.dtapp.net/gotime v1.0.5 h1:12aNgB2ULpP6QgQHEUkLilZ4ASvhpFxMFQkBwn0par8= go.dtapp.net/gotime v1.0.5/go.mod h1:Gq7eNLr2iMLP18UNWONRq4V3Uhf/ADp4bIrS+Tc6ktY= go.dtapp.net/gotrace_id v1.0.6 h1:q6s8jy50vt1820b69JKQaFqbhGS5yJGMVtocwOGOPO0= @@ -587,8 +587,8 @@ golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d h1:3qF+Z8Hkrw9sOhrFHti9TlB1Hkac1x+DNRkv0XQiFjo= -golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM= +golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20181106170214-d68db9428509/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -669,8 +669,8 @@ golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64 h1:UiNENfZ8gDvpiWw7IpOMQ27spWmThO1RwwdQVbJahJM= -golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 h1:v6hYoSR9T5oet+pMXwUWkbiVqx/63mlHjefrHmxwfeY= +golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=