Skip to content

Commit

Permalink
refactor(pkg/client/gorm): rename to pkg/client/gormx
Browse files Browse the repository at this point in the history
  • Loading branch information
amazing-gao committed Jun 4, 2021
1 parent 04afb17 commit 9174443
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pkg/client/gorm/alias.go → pkg/client/gormx/alias.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gorm
package gormx

import (
"gorm.io/gorm"
Expand Down
4 changes: 2 additions & 2 deletions pkg/client/gorm/config.go → pkg/client/gormx/config.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gorm
package gormx

import (
"time"
Expand Down Expand Up @@ -48,7 +48,7 @@ func StdConfig(key string, optionFunc ...OptionFunc) *Config {
// DefaultConfig 默认配置
func DefaultConfig(key string) *Config {
return &Config{
path: "gorm." + key,
path: "gormx." + key,
MaxIdleTime: time.Minute * 5,
MaxLifeTime: time.Hour,
MaxIdleConns: 2,
Expand Down
4 changes: 2 additions & 2 deletions pkg/client/gorm/gorm.go → pkg/client/gormx/gorm.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gorm
package gormx

import (
"context"
Expand Down Expand Up @@ -81,6 +81,6 @@ func (orm *Gorm) Shutdown(ctx context.Context) error {
return db.Close()
}

func (orm Gorm) DB() *gorm.DB {
func (orm Gorm) DB() *DB {
return orm.db
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gorm_test
package gormx_test

import (
"testing"
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/gorm/logger.go → pkg/client/gormx/logger.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gorm
package gormx

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ logger:
default:
level: debug

gorm:
gormx:
default:
driver: mysql
dsn: variety:Variety_test_2021@tcp(10.51.166.70:15028)/variety
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ logger:
default:
level: debug

gorm:
gormx:
default:
driver: mysql
dsn: variety:Variety_test_2021@tcp(10.51.166.70:15028)/variety

0 comments on commit 9174443

Please sign in to comment.