Documentation ¶
Overview ¶
** implement logger.Interface
// Interface logger interface type Interface interface { LogMode(LogLevel) Interface Info(context.Context, string, ...interface{}) Warn(context.Context, string, ...interface{}) Error(context.Context, string, ...interface{}) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error) }
Index ¶
- Constants
- func MysqlClientManagerInit(configs []MysqlClientConfig) error
- func NewMysqlClient(c MysqlClientConfig) (*gorm.DB, error)
- type MysqlClientConfig
- type MysqlClientManager
- type SqlLogger
- func (s *SqlLogger) Error(ctx context.Context, msg string, data ...interface{})
- func (s *SqlLogger) Info(ctx context.Context, msg string, data ...interface{})
- func (s *SqlLogger) LogMode(level logger.LogLevel) logger.Interface
- func (s *SqlLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (s *SqlLogger) Warn(ctx context.Context, msg string, data ...interface{})
Constants ¶
View Source
const ( Reset = "\033[0m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Magenta = "\033[35m" Cyan = "\033[36m" White = "\033[37m" BlueBold = "\033[34;1m" MagentaBold = "\033[35;1m" RedBold = "\033[31;1m" YellowBold = "\033[33;1m" )
Variables ¶
This section is empty.
Functions ¶
func MysqlClientManagerInit ¶
func MysqlClientManagerInit(configs []MysqlClientConfig) error
func NewMysqlClient ¶
func NewMysqlClient(c MysqlClientConfig) (*gorm.DB, error)
Types ¶
type MysqlClientConfig ¶
type MysqlClientManager ¶
type MysqlClientManager struct {
// contains filtered or unexported fields
}
func GetMysqlClientManager ¶
func GetMysqlClientManager() *MysqlClientManager
func (*MysqlClientManager) GetMysqlClient ¶
func (r *MysqlClientManager) GetMysqlClient(name string) *gorm.DB
Click to show internal directories.
Click to hide internal directories.