database

package
v0.0.0-...-e7e6c5a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MigrateModel = make([]any, 0)

Functions

func Command

func Command() []*cli.Command

func Gorm

func Gorm() *gorm.DB

func GormInit

func GormInit()

func GormMigrate

func GormMigrate(dst ...any)

func Qmgo

func Qmgo() *qmgo.Database

func QmgoInit

func QmgoInit()

func Redis

func Redis() *redis.Client

func RedisInit

func RedisInit()

func Register

func Register()

Types

type GormService

type GormService struct {
	// contains filtered or unexported fields
}

func (*GormService) Shutdown

func (s *GormService) Shutdown() error

type Logger

type Logger struct {
	SlowThreshold             time.Duration
	SourceField               string
	IgnoreRecordNotFoundError bool
	Logger                    zerolog.Logger
	LogLevel                  gormLogger.LogLevel
}

Logger Database Logs

func GormLogger

func GormLogger() *Logger

func (*Logger) Error

func (l *Logger) Error(ctx context.Context, s string, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(ctx context.Context, s string, args ...interface{})

func (*Logger) LogMode

func (l *Logger) LogMode(level gormLogger.LogLevel) gormLogger.Interface

func (*Logger) Trace

func (l *Logger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

func (*Logger) Warn

func (l *Logger) Warn(ctx context.Context, s string, args ...interface{})

type QmgoService

type QmgoService struct {
	// contains filtered or unexported fields
}

func (*QmgoService) Shutdown

func (s *QmgoService) Shutdown() error

type RedisService

type RedisService struct {
	// contains filtered or unexported fields
}

func (*RedisService) Shutdown

func (s *RedisService) Shutdown() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL