db

package
v0.0.0-...-72b67d5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnFileUploadFinished

func OnFileUploadFinished(filehash string, filename string, filesize int64, fileaddr string) bool

func OnUserFileUploadFinished

func OnUserFileUploadFinished(username, filehash, filename string, filesize int64) bool

更新用户文件表

func UpdateToken

func UpdateToken(username string, token string) bool

UpdateToken : 刷新用户登录的token

func UserSignin

func UserSignin(username string, encpwd string) bool

UserSignin : 判断密码是否一致

func UserSignup

func UserSignup(username string, passwd string) bool

UserSignup : 通过用户名及密码完成user表的注册操作

Types

type TableFile

type TableFile struct {
	FileHash string
	FileName sql.NullString
	FileSize sql.NullInt64
	FileAddr sql.NullString
}

func GetFileMeta

func GetFileMeta(filehash string) (*TableFile, error)

从mysql获取源文件信息

type User

type User struct {
	Username     string
	Email        string
	Phone        string
	SignupAt     string
	LastActiveAt string
	Status       int
}

User : 用户表model

func GetUserInfo

func GetUserInfo(username string) (User, error)

GetUserInfo : 查询用户信息

type UserFile

type UserFile struct {
	UserName    string
	FileHash    string
	FileName    string
	FileSize    int64
	UploadAt    string
	LastUpdated string
}

func QueryUserFileMetas

func QueryUserFileMetas(username string, limit int) ([]UserFile, error)

QueryUserFileMetas : 批量获取用户文件信息

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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