xorm_locks

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Xorm Locks

go get -u github.com/storage-lock/go-xorm-locks

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateStorageForXorm

func CreateStorageForXorm(engine *xorm.Engine, connectionManager storage.ConnectionManager[*sql.DB]) (storage.Storage, error)

CreateStorageForXorm 尝试从xorm创建Storage

func InitGlobalXormLockFactory

func InitGlobalXormLockFactory(engine *xorm.Engine) error

Types

type XormConnectionManager

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

XormConnectionManager 用来复用xorm(https://github.com/go-xorm/xorm)的数据库连接 TODO 2023-8-4 01:28:15 单元测试

func NewXormConnectionManager

func NewXormConnectionManager(engine *xorm.Engine) *XormConnectionManager

func (*XormConnectionManager) Name

func (x *XormConnectionManager) Name() string

func (*XormConnectionManager) Return

func (x *XormConnectionManager) Return(ctx context.Context, db *sql.DB) error

func (*XormConnectionManager) Shutdown

func (x *XormConnectionManager) Shutdown(ctx context.Context) error

func (*XormConnectionManager) Take

func (x *XormConnectionManager) Take(ctx context.Context) (*sql.DB, error)

type XormLockFactory

type XormLockFactory struct {
	*storage_lock_factory.StorageLockFactory[*sql.DB]
	// contains filtered or unexported fields
}
var GlobalXormLockFactory *XormLockFactory

func NewXormLockFactory

func NewXormLockFactory(engine *xorm.Engine) (*XormLockFactory, error)

Jump to

Keyboard shortcuts

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