xormDriver

package
v0.0.0-...-bda4ec2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

func New

func New(dsnConfigs []DsnConfig)

func Sync2

func Sync2(beans ...interface{})

Types

type Db

type Db struct {
	ID int64
	DsnConfig
	Engine *xorm.Engine
}

func DbMaster

func DbMaster() *Db

随机获取主数据库

func DbSlave

func DbSlave() *Db

随机获取只读(备用)数据库

type DsnConfig

type DsnConfig struct {
	DbType          string
	IsMaster        bool
	Dsn             string
	SqlLogLevel     int64
	SqlMaxIdleConns int64
	SqlMaxOpenConns int64
}

Jump to

Keyboard shortcuts

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