data

package
v0.0.0-...-3904f54 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDatabase

func GetDatabase(dbType, dsn string) (gorm.Dialector, error)

Types

type DB

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

func NewDB

func NewDB(gorm *gorm.DB, salt string) *DB

func (*DB) AddRule

func (db *DB) AddRule(request types.Rule) (string, error)

func (*DB) CheckUser

func (db *DB) CheckUser(username, password string) (*types.User, error)

func (*DB) CreateUser

func (db *DB) CreateUser(username, password string) error

func (*DB) DeleteUser

func (db *DB) DeleteUser(id string) error

func (*DB) ExistRule

func (db *DB) ExistRule(id string) error

func (*DB) GetRule

func (db *DB) GetRule(id string) (types.Rule, error)

func (*DB) GetRuleCount

func (db *DB) GetRuleCount() int64

func (*DB) GetRuleList

func (db *DB) GetRuleList(page int) ([]types.RuleItem, int64, error)

func (*DB) GetUser

func (db *DB) GetUser(id string) (types.User, error)

func (*DB) GetUserCount

func (db *DB) GetUserCount() int64

func (*DB) GetUserList

func (db *DB) GetUserList(page, pageSize int) ([]types.User, int64, error)

func (*DB) Init

func (db *DB) Init()

func (*DB) Migrate

func (db *DB) Migrate()

func (*DB) RemoveRule

func (db *DB) RemoveRule(id string) error

func (*DB) UpdatePassword

func (db *DB) UpdatePassword(id, password, newPassword string) error

func (*DB) UpdatePasswordAdmin

func (db *DB) UpdatePasswordAdmin(id, password string) error

func (*DB) UpdateRule

func (db *DB) UpdateRule(request types.Rule) error

func (*DB) UpdateUser

func (db *DB) UpdateUser(id string, request types.User) error

Jump to

Keyboard shortcuts

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