Documentation
¶
Index ¶
- func Module(opts ...di.Node) di.Node
- func NewGormDB(log *zap.Logger, dialecter gorm.Dialector) (*gorm.DB, error)
- func NewPostgresDialector(config Config) gorm.Dialector
- func UseMigrations(migrationsDirFS *embed.FS, paths ...string) di.Node
- func UseOtelLogger(opts ...di.Option) di.Node
- func UseOtelTraceMetrics(opts ...di.Option) di.Node
- type Config
- type ContextFn
- type Logger
- func (l Logger) Error(ctx context.Context, str string, args ...any)
- func (l Logger) Info(ctx context.Context, str string, args ...any)
- func (l Logger) LogMode(level gormlogger.LogLevel) gormlogger.Interface
- func (l Logger) ParamsFilter(ctx context.Context, sql string, params ...any) (string, []any)
- func (l Logger) SetAsDefault()
- func (l Logger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l Logger) Warn(ctx context.Context, str string, args ...any)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPostgresDialector ¶
Types ¶
type Logger ¶
type Logger struct {
ZapLogger *zap.Logger
LogLevel gormlogger.LogLevel
SlowThreshold time.Duration
SkipCallerLookup bool
IgnoreRecordNotFoundError bool
Context ContextFn
ParameterizedQueries bool
}
func (Logger) LogMode ¶
func (l Logger) LogMode(level gormlogger.LogLevel) gormlogger.Interface
func (Logger) ParamsFilter ¶
func (Logger) SetAsDefault ¶
func (l Logger) SetAsDefault()
Click to show internal directories.
Click to hide internal directories.