managers

package
v0.0.0-...-6a61234 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

Functions

func UsernameGenerator

func UsernameGenerator(db *ent.Client, firstName string, lastName string, userName *string) string

Types

type ChatManager

type ChatManager struct {
}

---------------------------------- CHAT MANAGEMENT --------------------------------

func (ChatManager) Create

func (obj ChatManager) Create(client *ent.Client, owner *ent.User, ctype chat.Ctype, recipientsOpts ...[]*ent.User) *ent.Chat

func (ChatManager) CreateGroup

func (obj ChatManager) CreateGroup(client *ent.Client, owner *ent.User, usersToAdd []*ent.User, data schemas.GroupChatCreateSchema) *ent.Chat

func (ChatManager) DropData

func (obj ChatManager) DropData(client *ent.Client)

func (ChatManager) GetByID

func (obj ChatManager) GetByID(client *ent.Client, id uuid.UUID) *ent.Chat

func (ChatManager) GetDMChat

func (obj ChatManager) GetDMChat(client *ent.Client, userObj *ent.User, recipientUser *ent.User) *ent.Chat

func (ChatManager) GetMessagesCount

func (obj ChatManager) GetMessagesCount(client *ent.Client, chatID uuid.UUID) int

func (ChatManager) GetSingleUserChat

func (obj ChatManager) GetSingleUserChat(client *ent.Client, userObj *ent.User, id uuid.UUID) *ent.Chat

func (ChatManager) GetSingleUserChatFullDetails

func (obj ChatManager) GetSingleUserChatFullDetails(client *ent.Client, userObj *ent.User, id uuid.UUID) *ent.Chat

func (ChatManager) GetUserChats

func (obj ChatManager) GetUserChats(client *ent.Client, userObj *ent.User) []*ent.Chat

func (ChatManager) GetUserGroup

func (obj ChatManager) GetUserGroup(client *ent.Client, userObj *ent.User, id uuid.UUID, detailedOpts ...bool) *ent.Chat

func (ChatManager) UpdateGroup

func (obj ChatManager) UpdateGroup(client *ent.Client, chatObj *ent.Chat, data schemas.GroupChatInputSchema) (*ent.Chat, *utils.ErrorResponse)

func (ChatManager) UserIsMember

func (obj ChatManager) UserIsMember(chat *ent.Chat, targetUser *ent.User) bool

func (ChatManager) UsernamesToAddAndRemoveValidations

func (obj ChatManager) UsernamesToAddAndRemoveValidations(client *ent.Client, chatObj *ent.Chat, chatUpdateQuery *ent.ChatUpdateOne, usernamesToAdd *[]string, usernamesToRemove *[]string) (*ent.ChatUpdateOne, *utils.ErrorResponse)

type CityManager

type CityManager struct {
}

---------------------------------- CITY MANAGEMENT --------------------------------

func (CityManager) All

func (obj CityManager) All(client *ent.Client, name string) []*ent.City

func (CityManager) Create

func (obj CityManager) Create(client *ent.Client, name string, country *ent.Country, region *ent.Region) *ent.City

func (CityManager) DropData

func (obj CityManager) DropData(client *ent.Client)

func (CityManager) GetByID

func (obj CityManager) GetByID(client *ent.Client, cityID uuid.UUID) *ent.City

type CommentManager

type CommentManager struct {
}

---------------------------------- COMMENT MANAGEMENT --------------------------------

func (CommentManager) Create

func (obj CommentManager) Create(client *ent.Client, author *ent.User, postID uuid.UUID, text string) *ent.Comment

func (CommentManager) DropData

func (obj CommentManager) DropData(client *ent.Client)

func (CommentManager) GetByPostID

func (obj CommentManager) GetByPostID(client *ent.Client, postID uuid.UUID) []*ent.Comment

func (CommentManager) GetBySlug

func (obj CommentManager) GetBySlug(client *ent.Client, slug string, opts ...bool) (*ent.Comment, *int, *utils.ErrorResponse)

func (CommentManager) Update

func (obj CommentManager) Update(comment *ent.Comment, author *ent.User, text string) *ent.Comment

type CountryManager

type CountryManager struct {
}

---------------------------------- COUNTRY MANAGEMENT --------------------------------

func (CountryManager) Create

func (obj CountryManager) Create(client *ent.Client, name string, code string) *ent.Country

type FileManager

type FileManager struct {
}

func (FileManager) Create

func (obj FileManager) Create(client *ent.Client, fileType string) *ent.File

func (FileManager) GetByID

func (obj FileManager) GetByID(client *ent.Client, id uuid.UUID) *ent.File

func (FileManager) Update

func (obj FileManager) Update(client *ent.Client, file *ent.File, resourceType string) *ent.File

func (FileManager) UpdateOrCreate

func (obj FileManager) UpdateOrCreate(client *ent.Client, fileObj *ent.File, resourceType string) *ent.File

type FriendManager

type FriendManager struct {
}

---------------------------------- FRIEND MANAGEMENT --------------------------------

func (FriendManager) Create

func (obj FriendManager) Create(client *ent.Client, requester *ent.User, requestee *ent.User, status friend.Status) *ent.Friend

func (FriendManager) DropData

func (obj FriendManager) DropData(client *ent.Client)

func (FriendManager) GetFriendRequests

func (obj FriendManager) GetFriendRequests(client *ent.Client, userObj *ent.User) []*ent.User

func (FriendManager) GetFriends

func (obj FriendManager) GetFriends(client *ent.Client, userObj *ent.User) []*ent.User

func (FriendManager) GetRequesteeAndFriendObj

func (obj FriendManager) GetRequesteeAndFriendObj(client *ent.Client, userObj *ent.User, username string, statusOpts ...string) (*ent.User, *ent.Friend, *utils.ErrorResponse)

type MessageManager

type MessageManager struct {
}

---------------------------------- MESSAGE MANAGEMENT --------------------------------

func (MessageManager) Create

func (obj MessageManager) Create(client *ent.Client, sender *ent.User, chat *ent.Chat, text *string, fileType *string) *ent.Message

func (MessageManager) DropData

func (obj MessageManager) DropData(client *ent.Client)

func (MessageManager) GetByID

func (obj MessageManager) GetByID(client *ent.Client, id uuid.UUID) *ent.Message

func (MessageManager) GetUserMessage

func (obj MessageManager) GetUserMessage(client *ent.Client, userObj *ent.User, id uuid.UUID) *ent.Message

func (MessageManager) Update

func (obj MessageManager) Update(client *ent.Client, message *ent.Message, text *string, fileType *string) *ent.Message

type NotificationManager

type NotificationManager struct {
}

---------------------------------- NOTIFICATION MANAGEMENT --------------------------------

func (NotificationManager) Create

func (obj NotificationManager) Create(client *ent.Client, sender *ent.User, ntype notification.Ntype, receiverIDs []uuid.UUID, post *ent.Post, comment *ent.Comment, reply *ent.Reply, text *string) *ent.Notification

func (NotificationManager) DropData

func (obj NotificationManager) DropData(client *ent.Client)

func (NotificationManager) Get

func (obj NotificationManager) Get(client *ent.Client, sender *ent.User, ntype notification.Ntype, post *ent.Post, comment *ent.Comment, reply *ent.Reply) *ent.Notification

func (NotificationManager) GetOrCreate

func (obj NotificationManager) GetOrCreate(client *ent.Client, sender *ent.User, ntype notification.Ntype, receiverIDs []uuid.UUID, post *ent.Post, comment *ent.Comment, reply *ent.Reply) (*ent.Notification, bool)

func (NotificationManager) GetQueryset

func (obj NotificationManager) GetQueryset(client *ent.Client, userID uuid.UUID) []*ent.Notification

func (NotificationManager) IsAmongReceivers

func (obj NotificationManager) IsAmongReceivers(client *ent.Client, notificationID uuid.UUID, receiverID uuid.UUID) bool

func (NotificationManager) MarkAsRead

func (obj NotificationManager) MarkAsRead(client *ent.Client, userID uuid.UUID)

func (NotificationManager) ReadOne

func (obj NotificationManager) ReadOne(client *ent.Client, userID uuid.UUID, notificationID uuid.UUID) *utils.ErrorResponse

type OtpManager

type OtpManager struct {
}

---------------------------------- OTP MANAGEMENT --------------------------------

func (OtpManager) CheckExpiration

func (obj OtpManager) CheckExpiration(otpObj *ent.Otp) bool

func (OtpManager) GetByUserID

func (obj OtpManager) GetByUserID(client *ent.Client, userId uuid.UUID) *ent.Otp

func (OtpManager) GetOrCreate

func (obj OtpManager) GetOrCreate(client *ent.Client, userId uuid.UUID) *ent.Otp

type PostManager

type PostManager struct {
}

---------------------------------- POST MANAGEMENT --------------------------------

func (PostManager) All

func (obj PostManager) All(client *ent.Client) []*ent.Post

func (PostManager) Create

func (obj PostManager) Create(client *ent.Client, author *ent.User, postData schemas.PostInputSchema) *ent.Post

func (PostManager) DropData

func (obj PostManager) DropData(client *ent.Client)

func (PostManager) GetBySlug

func (obj PostManager) GetBySlug(client *ent.Client, slug string, opts ...bool) (*ent.Post, *int, *utils.ErrorResponse)

func (PostManager) Update

func (obj PostManager) Update(client *ent.Client, post *ent.Post, postData schemas.PostInputSchema) *ent.Post

type ReactionManager

type ReactionManager struct {
}

---------------------------------- REACTIONS MANAGEMENT --------------------------------

func (ReactionManager) Create

func (obj ReactionManager) Create(client *ent.Client, userID uuid.UUID, focus string, focusID uuid.UUID, rtype reaction.Rtype) *ent.Reaction

func (ReactionManager) DropData

func (obj ReactionManager) DropData(client *ent.Client)

func (ReactionManager) GetByID

func (obj ReactionManager) GetByID(client *ent.Client, id uuid.UUID) (*ent.Reaction, *int, *utils.ErrorResponse)

func (ReactionManager) GetReactionsQueryset

func (obj ReactionManager) GetReactionsQueryset(client *ent.Client, fiberCtx *fiber.Ctx, focus string, slug string) ([]*ent.Reaction, *int, *utils.ErrorResponse)

func (ReactionManager) Update

func (obj ReactionManager) Update(reaction *ent.Reaction, focus string, id uuid.UUID, rtype reaction.Rtype) *ent.Reaction

func (ReactionManager) UpdateOrCreate

func (obj ReactionManager) UpdateOrCreate(client *ent.Client, user *ent.User, focus string, slug string, rtype reaction.Rtype) (*ent.Reaction, *ent.User, *int, *utils.ErrorResponse)

type RegionManager

type RegionManager struct {
}

---------------------------------- REGION MANAGEMENT --------------------------------

func (RegionManager) Create

func (obj RegionManager) Create(client *ent.Client, name string, country *ent.Country) *ent.Region

type ReplyManager

type ReplyManager struct {
}

---------------------------------- REPLY MANAGEMENT --------------------------------

func (ReplyManager) Create

func (obj ReplyManager) Create(client *ent.Client, author *ent.User, commentID uuid.UUID, text string) *ent.Reply

func (ReplyManager) DropData

func (obj ReplyManager) DropData(client *ent.Client)

func (ReplyManager) GetBySlug

func (obj ReplyManager) GetBySlug(client *ent.Client, slug string, opts ...bool) (*ent.Reply, *int, *utils.ErrorResponse)

func (ReplyManager) Update

func (obj ReplyManager) Update(reply *ent.Reply, author *ent.User, text string) *ent.Reply

type SiteDetailManager

type SiteDetailManager struct {
}

func (SiteDetailManager) Create

func (obj SiteDetailManager) Create(client *ent.Client) *ent.SiteDetail

func (SiteDetailManager) Get

func (obj SiteDetailManager) Get(client *ent.Client) *ent.SiteDetail

func (SiteDetailManager) GetOrCreate

func (obj SiteDetailManager) GetOrCreate(client *ent.Client) *ent.SiteDetail

type UserManager

type UserManager struct {
}

---------------------------------- OTP MANAGEMENT --------------------------------

func (UserManager) Create

func (obj UserManager) Create(client *ent.Client, userData schemas.RegisterUser, isStaff bool, isEmailVerified bool) *ent.User

func (UserManager) DropData

func (obj UserManager) DropData(client *ent.Client)

func (UserManager) GetByEmail

func (obj UserManager) GetByEmail(client *ent.Client, email string) *ent.User

func (UserManager) GetById

func (obj UserManager) GetById(client *ent.Client, id uuid.UUID) *ent.User

func (UserManager) GetByRefreshToken

func (obj UserManager) GetByRefreshToken(client *ent.Client, token string) *ent.User

func (UserManager) GetByUsername

func (obj UserManager) GetByUsername(client *ent.Client, username string) *ent.User

func (UserManager) GetByUsernames

func (obj UserManager) GetByUsernames(client *ent.Client, usernames []string, excludeOpts ...uuid.UUID) []*ent.User

func (UserManager) GetOrCreate

func (obj UserManager) GetOrCreate(client *ent.Client, userData schemas.RegisterUser, isEmailVerified bool, isStaff bool) *ent.User

func (UserManager) UpdateTokens

func (obj UserManager) UpdateTokens(user *ent.User, access string, refresh string) *ent.User

type UserProfileManager

type UserProfileManager struct {
}

---------------------------------- USER PROFILE MANAGEMENT --------------------------------

func (UserProfileManager) GetByUsername

func (obj UserProfileManager) GetByUsername(client *ent.Client, username string) (*ent.User, *utils.ErrorResponse)

func (UserProfileManager) GetUsers

func (obj UserProfileManager) GetUsers(client *ent.Client, userObj *ent.User) []*ent.User

func (UserProfileManager) Update

func (obj UserProfileManager) Update(client *ent.Client, profile *ent.User, profileData schemas.ProfileUpdateSchema) *ent.User

Jump to

Keyboard shortcuts

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