database

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIfLiked

func CheckIfLiked(videoID uint, userID string) (bool, error)

func CheckJwtOnBlacklist

func CheckJwtOnBlacklist(jwt string) (bool, error)

Check if JWT is on blacklist

func ConnectToDatabase

func ConnectToDatabase()

func ConnectToMongo

func ConnectToMongo()

func CreateComment

func CreateComment(comment model.Comment) error

func CreateLike

func CreateLike(videoID uint, userID string) error

Create video

func CreateVideo

func CreateVideo(video model.Video) error

Create video

func CreateVideoContent

func CreateVideoContent(video *model.VideoContent) map[string]interface{}

func DeleteLike

func DeleteLike(videoID uint, userID string) error

func DeleteUser

func DeleteUser(userID string) error

Delete a complete User by ID

func DeleteVideo

func DeleteVideo(videoId string, userId uint) error

Delete video by uuid

func DeleteVideoContent

func DeleteVideoContent(contentID primitive.ObjectID) map[string]interface{}

func GenerateVerificationCode added in v1.0.2

func GenerateVerificationCode(userID uint) (string, error)

Generate Verification Code for User

func GetAllUsers

func GetAllUsers() ([]model.UserDetailsPublic, error)

Get all Users

func GetComments

func GetComments(videoID string) ([]model.Comment, error)

func GetContentID

func GetContentID(videoUUID string) (string, error)

func GetPrivateUser

func GetPrivateUser(userID string) (*model.UserDetailsPrivate, error)

Get PrivateInformation for User for Settings etc.

func GetRecomendations

func GetRecomendations(limit int) (*[]model.Video, error)

func GetRecomendationsForUser

func GetRecomendationsForUser(limit int, uuid uint) (*[]model.Video, error)

func GetSearchResult

func GetSearchResult(query string) (*model.SearchResult, error)

func GetUser

func GetUser(userID string) (*model.UserDetailsPublic, error)

Get User Information by ID

func GetVideo

func GetVideo(videoId string) (*model.Video, error)

Get video by id

func GetVideoContent

func GetVideoContent(contentID primitive.ObjectID) map[string]interface{}

func GetVideoID

func GetVideoID(videoUUID string) (uint, error)

func GetVideoThumbnail added in v1.0.1

func GetVideoThumbnail(contentID primitive.ObjectID) (interface{}, error)

func GetVideos

func GetVideos() (*[]model.Video, error)

Get all Videos

func GetVideosFromUser

func GetVideosFromUser(userID string) (*[]model.Video, error)

Get all Videos from one user

func LoginUser

func LoginUser(login_data model.UserLogin) map[string]interface{}

Login Function, search for Users in database an retrun a JWT Token

func Logout

func Logout(jwt string) error

Add JWT to blacklist

func RegisterUser

func RegisterUser(user model.User) map[string]interface{}

Register User in Database with Error Handling

func UpdateUser

func UpdateUser(updateUser *model.User) error

Update User Information by ID

func UpdateVideo

func UpdateVideo(updateVideo model.Video, userId uint) error

Update video by id

func VerifyUser added in v1.0.2

func VerifyUser(userID uint, code 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