database

package
v0.0.4-beta Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 24 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 ConnCluster

func ConnCluster(name string) (*redis.ClusterClient, error)

func ConnSingle

func ConnSingle(name string) (*redis.Client, error)

func Gorm

func Gorm(name ...string) *gorm.DB

func GormCtx

func GormCtx(ctx context.Context) *gorm.DB

func GormInit

func GormInit()

func GormMigrate

func GormMigrate(dst ...any)

func Mongo

func Mongo(name ...string) *mongo.Database

func MongoInit

func MongoInit()

func Redis

func Redis(name ...string) *redis.Client

func RedisCluster

func RedisCluster(name ...string) *redis.ClusterClient

func RedisInit

func RedisInit()

func Register

func Register()

func SwitchGorm

func SwitchGorm(name string) error

func SyncDatabase

func SyncDatabase() error

Types

type GormService

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

func NewGorm

func NewGorm(name string) *GormService

func (*GormService) Shutdown

func (s *GormService) Shutdown() error

type Migrate

type Migrate struct {
	Model any
	Seed  func(db *gorm.DB)
}

type MongoService

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

func NewMongo

func NewMongo(name string) *MongoService

func (*MongoService) Shutdown

func (s *MongoService) Shutdown() error

type RedisClusterService

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

func NewRedisCluster

func NewRedisCluster(name string) *RedisClusterService

type RedisService

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

func NewRedis

func NewRedis(name string) *RedisService

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