db

package
v0.0.0-...-c448931 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUserAlreadyVerified returns error
	ErrUserAlreadyVerified = errors.New("User already verified")
	// ErrUserNotFound returns error
	ErrUserNotFound = errors.New("Cannot Find User")
	// ErrItemNotFound returns error
	ErrItemNotFound = errors.New("Cannot Find Item")
)

Functions

func AddList

func AddList(userid int, name, description string, public bool) error

func AddPlayListToItem

func AddPlayListToItem(userid, itemid, playlistid int) error

func AddSong

func AddSong(userid int, name, description, link string) error

func AddTag

func AddTag(userid int, name string) error

func AddTagToItem

func AddTagToItem(userid, itemid, tagid int) error

func CheckPasswordVerify

func CheckPasswordVerify(code, new string) (bool, error)

CheckPasswordVerify handles password change verify codes

func CheckVerify

func CheckVerify(code string) (bool, error)

CheckVerify For Email Check

func CreateUser

func CreateUser(email, name, password string) error

CreateUser controller

func DB

func DB() *gorm.DB

DB returns Database Connection

func FindUser

func FindUser(email string) (*structure.User, error)

FindUser With Email

func FindUserByID

func FindUserByID(id int) (*structure.User, error)

FindUserByID controller

func GetList

func GetList(userid int) (data []structure.PlayList, err error)

func GetListDetail

func GetListDetail(userid, listid int) ([]structure.PlayItem, error)

func GetSongs

func GetSongs(userid int) (data []structure.PlayItem, err error)

func GetTag

func GetTag(userid int) (data []structure.PlayTag, err error)

func InitDB

func InitDB(dbtype string, connectionInfo string) (*gorm.DB, error)

InitDB DataBase Connection

func RemoveList

func RemoveList(userid, target int) error

func RemovePlayListFromItem

func RemovePlayListFromItem(userid, itemid, playlistid int) error

func RemoveSong

func RemoveSong(userid, target int) error

func RemoveTag

func RemoveTag(userid, target int) error

func RemoveTagFromItem

func RemoveTagFromItem(userid, itemid, tagid int) error

func SetPasswordVerifyCode

func SetPasswordVerifyCode(email, code string) error

SetPasswordVerifyCode handles password change event

func UpdateList

func UpdateList(userid, target int, name, description string, public bool) error

func UpdatePassword

func UpdatePassword(name, password string) error

UpdatePassword updates user's password

func UpdateSong

func UpdateSong(userid, target int, name, description, link string) error

func UpdateTag

func UpdateTag(userid, target int, name string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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