entity

package
v0.0.0-...-f403545 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRequestId

func NewRequestId() string

NewRequestId @Description:

func NewSessionMaker

func NewSessionMaker(ori Session, factory SessionFactory) (Session, *SessionMaker)

NewSessionMaker new session maker

Types

type Context

type Context struct {
	context.Context
	User      *ftpb.UserInfo
	RequestID string
}

Context context in callpath

func NewDefaultContext

func NewDefaultContext() Context

NewDefaultContext ....

type Session

type Session = *gorm.DB

Session session rename

type SessionFactory

type SessionFactory interface {
	NewSession() Session
	DB() Session
}

SessionFactory ....

type SessionMaker

type SessionMaker struct {
	SkipTransSession Session
	// contains filtered or unexported fields
}

SessionMaker ....

func (*SessionMaker) Close

func (s *SessionMaker) Close(errp *error) error

Close 关闭session

如果origin session != nil, 说明是使用上游session, 不管执行异常还是什么, 不处理 如果origin session 为nil ,说明是当前新创建的session, 需要对其做后续处理。

如果执行正常, 需要commit
如果执行异常,需要rollback最后close

type User

type User struct {
	ID   int64
	Name string
	Type string
}

User 登陆用户定义

Jump to

Keyboard shortcuts

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