Documentation ¶
Index ¶
- func AppendUserFile(nickname string, fileSha1 string) bool
- func CheckFileRecord(fileSha1 string) bool
- func CheckUserToken(nickname string, token string) bool
- func DeleteFileRecord(fileSha1 string) bool
- func DeleteUserFile(nickname string, fileSha1 string) bool
- func InsertFileRecord(fileSha1 string, fileName string, fileSize int64, filePath string, ...) bool
- func UpdateFileRecord(fileSha1 string, fileName string, filePath string) bool
- func UpdateUserToken(nickname string, token string) bool
- func UserSignIn(nickname string, password string) bool
- func UserSignUp(nickname string, password string) bool
- type FileRecord
- type UserFileRecord
- type UserRecord
- type UserTokenRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendUserFile ¶
AppendUserFile is to append user file to database
func CheckFileRecord ¶
CheckFileRecord is to check whether a database record of file exists
func CheckUserToken ¶
CheckUserToken is to check whether the user token is valid
func DeleteFileRecord ¶
DeleteFileRecord is to delete a database record of a file
func DeleteUserFile ¶
DeleteUserFile is to delete user file in database
func InsertFileRecord ¶
func InsertFileRecord(fileSha1 string, fileName string, fileSize int64, filePath string, enableTimes int64, enableDays int64, createAt string, updateAt string) bool
InsertFileRecord is to insert a database record of a file
func UpdateFileRecord ¶
UpdateFileRecord is to update a database record of a file
func UpdateUserToken ¶
UpdateUserToken is to update user token once trying to sign in
func UserSignIn ¶
UserSignIn is to select a database record of a user and compare it with params
func UserSignUp ¶
UserSignUp is to insert a database record of a user
Types ¶
type FileRecord ¶
type FileRecord struct { FileSha1 string FileName sql.NullString FileSize sql.NullInt64 FilePath sql.NullString EnableTimes sql.NullInt64 EnableDays sql.NullInt64 CreateAt sql.NullString UpdateAt sql.NullString }
FileRecord is a database record of a file
func SelectFileRecord ¶
func SelectFileRecord(fileSha1 string) (*FileRecord, bool)
SelectFileRecord is to select a database record of a file by fileSha1
func SelectFileRecords ¶
func SelectFileRecords(limitCount int) ([]FileRecord, bool)
SelectFileRecords is to select database records of files by limitCount
type UserFileRecord ¶
UserFileRecord is a database record of a user file
func GetUserFiles ¶
func GetUserFiles(nickname string, limitCount int) ([]UserFileRecord, bool)
GetUserFiles is to retrieve user files from database
type UserRecord ¶
type UserRecord struct { Nickname string Realname string Gender int Birthday string Campus string School string Major string Grade string Class string Dormitory string Department string Email string Phone string Wechat string QQ string SignUpAt string SignInAt string Status int }
UserRecord is a database record of a user
func GetUserInfo ¶
func GetUserInfo(nickname string) (*UserRecord, bool)
GetUserInfo is to retrieve user information from the database
type UserTokenRecord ¶
UserTokenRecord is a database record of a user token