Documentation ¶
Index ¶
- Variables
- func GenerateDSN(options DBOptions) (string, error)
- func IsValidDriver(driver string) bool
- type DBOptions
- type Database
- type GormLogger
- func (l GormLogger) Error(ctx context.Context, msg string, data ...interface{})
- func (l GormLogger) Info(ctx context.Context, msg string, data ...interface{})
- func (l *GormLogger) LogMode(level logger.LogLevel) logger.Interface
- func (l GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l GormLogger) Warn(ctx context.Context, msg string, data ...interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // TimestampFieldName is the field name used for the timestamp field. TimestampFieldName = zerolog.TimestampFieldName // DurationFieldName is the field name used for the duration field. DurationFieldName = "elapsed" // FileFieldName is the field name used for the file field. FileFieldName = "file" // SqlFieldName is the field name used for the sql field. SqlFieldName = "sql" // RowsFieldName is the field name used for the rows field. RowsFieldName = "rows" )
Functions ¶
func GenerateDSN ¶
func IsValidDriver ¶
Types ¶
type GormLogger ¶
type GormLogger struct { // SlowThreshold is the delay which define the query as slow SlowThreshold time.Duration // IgnoreRecordNotFoundError is to ignore when the record is not found IgnoreRecordNotFoundError bool // FieldsOrder defines the order of fields in output. FieldsOrder []string // FieldsExclude defines contextual fields to not display in output. FieldsExclude []string }
func NewGormLogger ¶
func NewGormLogger() *GormLogger
NewGormLogger creates and initializes a new GormLogger.
func (GormLogger) Error ¶
func (l GormLogger) Error(ctx context.Context, msg string, data ...interface{})
Error print error messages
func (GormLogger) Info ¶
func (l GormLogger) Info(ctx context.Context, msg string, data ...interface{})
Info print info
func (*GormLogger) LogMode ¶
func (l *GormLogger) LogMode(level logger.LogLevel) logger.Interface
LogMode log mode
Click to show internal directories.
Click to hide internal directories.