Documentation
¶
Index ¶
- Variables
- func GetDbInterfaces() []interface{}
- func Init(autoMigrate bool, logger *zap.Logger) (*gorm.DB, error)
- type ZapLogger
- func (zl *ZapLogger) Error(ctx context.Context, msg string, data ...interface{})
- func (zl *ZapLogger) Info(ctx context.Context, msg string, data ...interface{})
- func (zl *ZapLogger) LogMode(level logger.LogLevel) logger.Interface
- func (zl *ZapLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (zl *ZapLogger) Warn(ctx context.Context, msg string, data ...interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DB_HOST = "localhost" DB_USER = "tp_rest_api" DB_PASSWORD = "tp-rest-api-pwd" DB_NAME = "threeport_api" DB_PORT = "26257" DB_SSL_MODE = "disable" )
Functions ¶
func GetDbInterfaces ¶
func GetDbInterfaces() []interface{}
Return all database init object interfaces.
Types ¶
type ZapLogger ¶
ZapLogger is a custom GORM logger that forwards log messages to a Zap logger.
func (*ZapLogger) Error ¶
Error overrides the standard GORM logger's Error method to forward log messages to the zap logger.
func (*ZapLogger) Info ¶
Info overrides the standard GORM logger's Info method to forward log messages to the zap logger.
func (*ZapLogger) LogMode ¶
LogMode overrides the standard GORM logger's LogMode method to set the logger mode.
Click to show internal directories.
Click to hide internal directories.