db

package
v0.0.0-...-33648b2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsFileUploaded

func IsFileUploaded(filehash string) bool

IsFileUploaded

func OnFileRemoved

func OnFileRemoved(filehash string) bool

OnFileRemoved : delete file (just change status=2)

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: Update the token when a user logins

func UserSignUp

func UserSignUp(username string, passwd string) bool

func UserSignin

func UserSignin(username string, encpwd string) bool

UserSignin: Judge passward

func UserTokenVerify

func UserTokenVerify(username string, token string) bool

UserTokenVerify

Types

type TableFile

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

TableFile

func GetFileMeta

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

func GetFileMetaList

func GetFileMetaList(limit int) ([]TableFile, error)

GetFileMetaList : get the list of meta from mysql

type User

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

User : user info table (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