Documentation ¶
Index ¶
- type Config
- type ConfigItem
- type GormDBManager
- type Logger
- func (l *Logger) Error(ctx context.Context, msg string, data ...interface{})
- func (l *Logger) Info(ctx context.Context, msg string, data ...interface{})
- func (l *Logger) LogMode(level logger.LogLevel) logger.Interface
- func (l *Logger) Trace(ctx context.Context, begin time.Time, ...)
- func (l *Logger) Warn(ctx context.Context, msg string, data ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Master *ConfigItem `json:"master"` Slaves []*ConfigItem `json:"slaves"` }
type ConfigItem ¶
type GormDBManager ¶
type GormDBManager struct {
// contains filtered or unexported fields
}
func NewGormDBManager ¶
func NewGormDBManager(configPath string, logger *log.Helper) *GormDBManager
func (*GormDBManager) MasterDB ¶
func (g *GormDBManager) MasterDB() *gorm.DB
func (*GormDBManager) SlaveDB ¶
func (g *GormDBManager) SlaveDB() *gorm.DB
Click to show internal directories.
Click to hide internal directories.