models

package
v0.0.0-...-d0df74b Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentOrmer

type CommentOrmer interface {
	GetAllByHash(hash string) (comments []datatransfers.Comment, err error)
	InsertComment(comment datatransfers.CommentInsert) (ID primitive.ObjectID, err error)
}

func NewCommentOrmer

func NewCommentOrmer(db *mongo.Client) CommentOrmer

type LikeOrmer

type LikeOrmer interface {
	GetOneByUserIDHash(userID string, hash string) (like datatransfers.Like, err error)
	GetCountByHash(hash string) (count int, err error)
	InsertLike(like datatransfers.Like) (ID primitive.ObjectID, err error)
	RemoveLikeByUserIDHash(userID string, hash string) (err error)
}

func NewLikeOrmer

func NewLikeOrmer(db *mongo.Client) LikeOrmer

type SubscriptionOrmer

type SubscriptionOrmer interface {
	GetSubscriptionsByAuthorID(authorID string) (subscribers []datatransfers.Subscription, err error)
	GetCountByAuthorID(authorID string) (count int, err error)
	GetOneByAuthorIDUserID(authorID, userID string) (subscription datatransfers.Subscription, err error)
	InsertSubscription(subscription datatransfers.Subscription) (ID primitive.ObjectID, err error)
	RemoveSubscriptionByAuthorIDUserID(authorID, userID string) (err error)
}

func NewSubscriptionOrmer

func NewSubscriptionOrmer(db *mongo.Client) SubscriptionOrmer

type UserOrmer

type UserOrmer interface {
	GetOneByID(ID string) (user datatransfers.User, err error)
	GetOneByUsername(username string) (user datatransfers.User, err error)
	CheckUnique(field, value string) (err error)
	InsertUser(user datatransfers.User) (err error)
	UpdateUser(user datatransfers.User) (err error)
	DeleteOneByID(ID string) (err error)
}

func NewUserOrmer

func NewUserOrmer(db *mongo.Client) UserOrmer

type VideoOrmer

type VideoOrmer interface {
	GetRecent(variant string, count int, offset int) (videos []datatransfers.Video, err error)
	GetTrending(count int, offset int) (videos []datatransfers.Video, err error)
	GetLiked(userID string, count int, offset int) (videos []datatransfers.Video, err error)
	GetSubscribed(userID string, count int, offset int) (videos []datatransfers.Video, err error)
	GetAllVODByAuthor(author string, withUnlisted bool) (videos []datatransfers.Video, err error)
	GetAllVODByAuthorPaginated(author string, withUnlisted bool, count int, offset int) (videos []datatransfers.Video, err error)
	Search(query string, count, offset int) (videos []datatransfers.Video, err error)
	GetLiveByAuthor(userID string) (datatransfers.Video, error)
	GetOneByHash(hash string) (datatransfers.Video, error)
	IncrementViews(hash string, decrement ...bool) (err error)
	SetLive(authorID string, pending, live bool) (err error)
	SetResolution(hash string, resolution int) (err error)
	InsertVideo(video datatransfers.VideoInsert) (ID primitive.ObjectID, err error)
	EditVideo(video datatransfers.VideoInsert) (err error)
	DeleteOneByID(ID primitive.ObjectID) (err error)
	CheckUnique(title string) (err error)
}

func NewVideoOrmer

func NewVideoOrmer(db *mongo.Client) VideoOrmer

Jump to

Keyboard shortcuts

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