user_model

package
v5.0.0-...-b98a0e9 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTreeNode

func NewTreeNode(path string, withNode ...*tree.Node) tree.ITreeNode

NewTreeNode creates an ITreeNode with a path, and optionally more node info for creation

func NewTreeNodePtr

func NewTreeNodePtr(path string, withNode ...*tree.Node) *tree.ITreeNode

NewTreeNodePtr creates an ITreeNode with a path, and optionally more node info for creation, and return its pointer

Types

type Querier

type Querier interface {
	// FilterWithLowerVal is a code snippet to filter a column using its lower value
	//
	// where lower(@@column) = lower(@value) (gen.M, error)
	FilterWithLowerVal(column string, value string)
}

type Query

type Query struct {
	User          user
	UserAttribute userAttribute
	UserRole      userRole
	// contains filtered or unexported fields
}

func Use

func Use(db *gorm.DB, opts ...gen.DOOption) *Query

func (*Query) Available

func (q *Query) Available() bool

func (*Query) Begin

func (q *Query) Begin(opts ...*sql.TxOptions) *QueryTx

func (*Query) ReadDB

func (q *Query) ReadDB() *Query

func (*Query) ReplaceDB

func (q *Query) ReplaceDB(db *gorm.DB) *Query

func (*Query) Transaction

func (q *Query) Transaction(fc func(tx *Query) error, opts ...*sql.TxOptions) error

func (*Query) WithContext

func (q *Query) WithContext(ctx context.Context) *queryCtx

func (*Query) WriteDB

func (q *Query) WriteDB() *Query

type QueryTx

type QueryTx struct {
	*Query
	Error error
}

func (*QueryTx) Commit

func (q *QueryTx) Commit() error

func (*QueryTx) Rollback

func (q *QueryTx) Rollback() error

func (*QueryTx) RollbackTo

func (q *QueryTx) RollbackTo(name string) error

func (*QueryTx) SavePoint

func (q *QueryTx) SavePoint(name string) error

type User

type User struct {
	tree.TreeNode
}

func (*User) TableName

func (*User) TableName(namer schema.Namer) string

TableName is kept for backward compatibility

type UserAttribute

type UserAttribute struct {
	UUID  string `gorm:"column:uuid; primaryKey; type: varchar(128) not null; index:,composite:ui;"`
	Name  string `gorm:"column:name; primaryKey;type: varchar(255) not null;"`
	Value string `gorm:"column:value;"`
	User  *User  `gorm:"foreignKey:UUID;constraint:OnDelete:CASCADE;"`
}

type UserRole

type UserRole struct {
	UUID   string `gorm:"column:uuid; primaryKey; type: varchar(128) not null; index:,composite:ui;"`
	Role   string `gorm:"column:name; primaryKey; type: varchar(255) not null;"`
	Weight int    `gorm:"column:weight;type:int;default:0;"`
	User   *User  `gorm:"foreignKey:UUID;constraint:OnDelete:CASCADE;"`
}

Jump to

Keyboard shortcuts

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