dbutil

package
v0.1.67 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: LGPL-2.1 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateDB

func MigrateDB(services ...any) error

func MongoDB

func MongoDB(ctx service.Context, tag string) *mongo.Client

func RedisDB

func RedisDB(ctx service.Context, tag string) *redis.Client

func SQLDB

func SQLDB(ctx service.Context, tag string) *gorm.DB

Types

type DB

type DB interface {
	*gorm.DB | *mongo.Client | *redis.Client
}

type DBService

type DBService[T DB] struct {
	DB T
}

func (*DBService[T]) BindDB added in v0.1.67

func (s *DBService[T]) BindDB(db T)

type IMigrateDB

type IMigrateDB interface {
	MigrateDB() error
}

Jump to

Keyboard shortcuts

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