interfaces

package
v1.0.1006 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	// 设置配置
	WithConfig(map[string]any) Database

	// 获取配置
	GetConfig(string) any

	// 设置驱动
	WithDriver(Driver) Database

	// 获取驱动
	GetDriver() Driver

	// 连接
	GetConnection() *gorm.DB

	// 使用 debug 连接
	GetConnectionWithDebug() *gorm.DB

	// 关闭
	Close()
}

*

  • 数据库接口 *
  • @create 2021-9-15
  • @author deatil

type Driver

type Driver interface {
	// 设置配置
	WithConfig(map[string]any) Driver

	// 获取配置
	GetConfig(string) any

	// 连接
	GetConnection() *gorm.DB

	// 带debug连接
	GetConnectionWithDebug() *gorm.DB

	// 关闭
	Close()
}

*

  • 驱动接口 *
  • @create 2021-9-15
  • @author deatil

Jump to

Keyboard shortcuts

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