dbpack

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIsAdmin added in v0.0.5

func CheckIsAdmin(userID string) (isAdmin bool)

CheckIsAdmin 检查是否是管理员

@param userID
@return isAdmin

func GetAdminLevel added in v0.0.5

func GetAdminLevel(userID string) int

GetAdminLevel 获取管理员等级

@param userID
@return level

func GetDbConnection added in v0.0.5

func GetDbConnection() *gorm.DB

GetDbConnection returns the db connection

@return *gorm.DB

Types

type Administrator added in v0.0.5

type Administrator struct {
	gorm.Model
	UserID   int64  `json:"user_id"`
	UserName string `json:"user_name"`
	Level    int64  `json:"level"`
}

Administrator is the struct of administrator

type CommandInfo added in v0.0.5

type CommandInfo struct {
	CommandName     string    `json:"command_name" gorm:"primaryKey;autoIncrement:false"`
	CommandDesc     string    `json:"command_desc"`
	CommandParamLen int       `json:"command_param_len"`
	CommandType     string    `json:"command_type"`
	CreatedAt       time.Time `json:"created_at" gorm:"autoCreateTime"`
	UpdatedAt       time.Time `json:"updated_at" gorm:"autoUpdateTime"`
}

CommandInfo is the struct of command info

func GetCommandInfo added in v0.0.5

func GetCommandInfo(command string) (commandInfoList []*CommandInfo, err error)

GetCommandInfo 获取命令信息

@param command
@return info

func GetCommandInfoWithOpt added in v0.0.5

func GetCommandInfoWithOpt(optionf string) (commandInfoList []*CommandInfo, err error)

GetCommandInfoWithOpt 获取命令信息

@param option
@return info

Jump to

Keyboard shortcuts

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