Documentation
¶
Index ¶
- func AvatarUrl(user *ent.User) *string
- func FullName(user *ent.User) string
- type AcceptFriendRequestSchema
- type ChatResponseSchema
- type ChatSchema
- type ChatsResponseDataSchema
- type ChatsResponseSchema
- type CitiesResponseSchema
- type CitySchema
- type CommentInputSchema
- type CommentResponseSchema
- type CommentSchema
- type CommentWithRepliesResponseDataSchema
- type CommentWithRepliesResponseSchema
- type CommentWithRepliesSchema
- type CommentsResponseDataSchema
- type CommentsResponseSchema
- type DeleteUserSchema
- type EmailRequestSchema
- type GroupChatCreateSchema
- type GroupChatInputResponseDataSchema
- type GroupChatInputResponseSchema
- type GroupChatInputSchema
- type GroupChatSchema
- type LatestMessageSchema
- type LoginResponseSchema
- type LoginSchema
- type MessageCreateResponseDataSchema
- type MessageCreateResponseSchema
- type MessageCreateSchema
- type MessageSchema
- type MessageUpdateSchema
- type MessagesResponseDataSchema
- type MessagesSchema
- type NotificationSchema
- type NotificationsResponseDataSchema
- type NotificationsResponseSchema
- type PaginatedResponseDataSchema
- type PostInputResponseDataSchema
- type PostInputResponseSchema
- type PostInputSchema
- type PostResponseSchema
- type PostSchema
- type PostsResponseDataSchema
- type PostsResponseSchema
- type ProfileResponseSchema
- type ProfileSchema
- type ProfileUpdateResponseDataSchema
- type ProfileUpdateResponseSchema
- type ProfileUpdateSchema
- type ProfilesResponseDataSchema
- type ProfilesResponseSchema
- type ReactionInputSchema
- type ReactionResponseSchema
- type ReactionSchema
- type ReactionsResponseDataSchema
- type ReactionsResponseSchema
- type ReadNotificationSchema
- type RefreshTokenSchema
- type RegisterResponseSchema
- type RegisterUser
- type ReplyResponseSchema
- type ReplySchema
- type ResponseSchema
- type SendFriendRequestSchema
- type SetNewPasswordSchema
- type SiteDetail
- type SiteDetailResponseSchema
- type TokensResponseSchema
- type UserDataSchema
- type VerifyEmailRequestSchema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChatResponseSchema ¶
type ChatResponseSchema struct { ResponseSchema Data MessagesSchema `json:"data"` }
type ChatSchema ¶
type ChatSchema struct { Edges *ent.ChatEdges `json:"edges,omitempty" swaggerignore:"true"` ID uuid.UUID `json:"id" example:"d10dde64-a242-4ed0-bd75-4c759644b3a6"` Owner UserDataSchema `json:"owner"` Name *string `json:"name" example:"Correct Group"` Ctype string `json:"ctype" example:"DM"` Description *string `json:"description" example:"A nice group for tech enthusiasts"` LatestMessage *LatestMessageSchema `json:"latest_message"` Image *string `json:"image" example:"https://img.url"` CreatedAt time.Time `json:"created_at" example:"2024-01-14T19:00:02.613124+01:00"` UpdatedAt time.Time `json:"updated_at" example:"2024-01-14T19:00:02.613124+01:00"` }
func (ChatSchema) Init ¶
func (chat ChatSchema) Init() ChatSchema
type ChatsResponseDataSchema ¶
type ChatsResponseDataSchema struct { PaginatedResponseDataSchema Items []ChatSchema `json:"chats"` }
RESPONSE SCHEMAS CHATS
func (ChatsResponseDataSchema) Init ¶
func (data ChatsResponseDataSchema) Init() ChatsResponseDataSchema
type ChatsResponseSchema ¶
type ChatsResponseSchema struct { ResponseSchema Data ChatsResponseDataSchema `json:"data"` }
type CitiesResponseSchema ¶
type CitiesResponseSchema struct { ResponseSchema Data []CitySchema `json:"data"` }
RESPONSE SCHEMAS CITIES
func (CitiesResponseSchema) Init ¶
func (data CitiesResponseSchema) Init() CitiesResponseSchema
type CitySchema ¶
type CitySchema struct { Edges *ent.CityEdges `json:"edges,omitempty" swaggerignore:"true"` ID uuid.UUID `json:"id" example:"d10dde64-a242-4ed0-bd75-4c759644b3a6"` Name string `json:"name" example:"Lekki"` Region *string `json:"region" example:"Lagos"` Country string `json:"country" example:"Nigeria"` }
func (CitySchema) Init ¶
func (city CitySchema) Init() CitySchema
type CommentInputSchema ¶
type CommentInputSchema struct {
Text string `json:"text" example:"Jesus is Lord"`
}
type CommentResponseSchema ¶
type CommentResponseSchema struct { ResponseSchema Data CommentSchema `json:"data"` }
type CommentSchema ¶
type CommentSchema struct { ReplySchema Edges *ent.CommentEdges `json:"edges,omitempty" swaggerignore:"true"` RepliesCount uint `json:"replies_count" example:"50"` }
func (CommentSchema) Init ¶
func (comment CommentSchema) Init() CommentSchema
type CommentWithRepliesResponseDataSchema ¶
type CommentWithRepliesResponseDataSchema struct { PaginatedResponseDataSchema Items []ReplySchema `json:"items"` }
COMMENTS & REPLIES
func (CommentWithRepliesResponseDataSchema) Init ¶
func (data CommentWithRepliesResponseDataSchema) Init() CommentWithRepliesResponseDataSchema
type CommentWithRepliesResponseSchema ¶
type CommentWithRepliesResponseSchema struct { ResponseSchema Data CommentWithRepliesSchema `json:"data"` }
type CommentWithRepliesSchema ¶
type CommentWithRepliesSchema struct { Comment CommentSchema `json:"comment"` Replies CommentWithRepliesResponseDataSchema `json:"replies"` }
type CommentsResponseDataSchema ¶
type CommentsResponseDataSchema struct { PaginatedResponseDataSchema Items []CommentSchema `json:"comments"` }
func (CommentsResponseDataSchema) Init ¶
func (data CommentsResponseDataSchema) Init() CommentsResponseDataSchema
type CommentsResponseSchema ¶
type CommentsResponseSchema struct { ResponseSchema Data CommentsResponseDataSchema `json:"data"` }
type DeleteUserSchema ¶
type DeleteUserSchema struct {
Password string `json:"password" validate:"required" example:"password"`
}
type EmailRequestSchema ¶
type EmailRequestSchema struct {
Email string `json:"email" validate:"required,min=5,email" example:"johndoe@email.com"`
}
type GroupChatCreateSchema ¶
type GroupChatCreateSchema struct { Name string `json:"name" validate:"required,max=100" example:"Dopest Group"` Description *string `json:"description" validate:"omitempty,max=1000" example:"This is a group for bosses."` UsernamesToAdd []string `json:"usernames_to_add" validate:"required,min=1,max=99" example:"john-doe"` FileType *string `json:"file_type" validate:"omitempty,file_type_validator" example:"image/jpeg"` }
type GroupChatInputResponseDataSchema ¶
type GroupChatInputResponseDataSchema struct { GroupChatSchema Image *string `json:"image,omitempty" swaggerignore:"true"` // Remove image during create & update FileUploadData *utils.SignatureFormat `json:"file_upload_data"` }
func (GroupChatInputResponseDataSchema) Init ¶
func (groupChatData GroupChatInputResponseDataSchema) Init(fileType *string) GroupChatInputResponseDataSchema
type GroupChatInputResponseSchema ¶
type GroupChatInputResponseSchema struct { ResponseSchema Data GroupChatInputResponseDataSchema `json:"data"` }
type GroupChatInputSchema ¶
type GroupChatInputSchema struct { Name *string `json:"name" validate:"omitempty,max=100" example:"Dopest Group"` Description *string `json:"description" validate:"omitempty,max=1000" example:"This is a group for bosses."` UsernamesToAdd *[]string `json:"usernames_to_add" validate:"omitempty,min=1,max=99" example:"john-doe"` UsernamesToRemove *[]string `json:"usernames_to_remove" validate:"omitempty,min=1,max=99,usernames_to_update_validator" example:"john-doe"` FileType *string `json:"file_type" validate:"omitempty,file_type_validator" example:"image/jpeg"` }
type GroupChatSchema ¶
type GroupChatSchema struct { Edges *ent.ChatEdges `json:"edges,omitempty" swaggerignore:"true"` ID uuid.UUID `json:"id"` Name string `json:"name" example:"Correct Group"` Description *string `json:"description" example:"Jesus is Lord"` Image *string `json:"image" example:"https://img.url"` Users []UserDataSchema `json:"users"` }
func (GroupChatSchema) Init ¶
func (chat GroupChatSchema) Init() GroupChatSchema
type LatestMessageSchema ¶
type LatestMessageSchema struct { Sender UserDataSchema `json:"sender"` Text *string `json:"text"` File *string `json:"file"` }
type LoginResponseSchema ¶
type LoginResponseSchema struct { ResponseSchema Data TokensResponseSchema `json:"data"` }
type LoginSchema ¶
type MessageCreateResponseDataSchema ¶
type MessageCreateResponseDataSchema struct { MessageSchema File *string `json:"file,omitempty" swaggerignore:"true"` // Remove image during create & update FileUploadData *utils.SignatureFormat `json:"file_upload_data"` }
func (MessageCreateResponseDataSchema) Init ¶
func (messageData MessageCreateResponseDataSchema) Init(fileType *string) MessageCreateResponseDataSchema
type MessageCreateResponseSchema ¶
type MessageCreateResponseSchema struct { ResponseSchema Data MessageCreateResponseDataSchema `json:"data"` }
type MessageCreateSchema ¶
type MessageCreateSchema struct { ChatID *uuid.UUID `json:"chat_id" validate:"omitempty" example:"d10dde64-a242-4ed0-bd75-4c759644b3a6"` Username *string `json:"username,omitempty" validate:"required_without=ChatID" example:"john-doe"` Text *string `json:"text" validate:"required_without=FileType" example:"I am not in danger skyler, I am the danger"` FileType *string `json:"file_type" validate:"omitempty,file_type_validator" example:"image/jpeg"` }
type MessageSchema ¶
type MessageSchema struct { Edges *ent.MessageEdges `json:"edges,omitempty" swaggerignore:"true"` ID uuid.UUID `json:"id"` ChatID uuid.UUID `json:"chat_id"` Sender UserDataSchema `json:"sender"` Text *string `json:"text" example:"Jesus is Lord"` File *string `json:"file" example:"https://img.url"` CreatedAt time.Time `json:"created_at" example:"2024-01-14T19:00:02.613124+01:00"` UpdatedAt time.Time `json:"updated_at" example:"2024-01-14T19:00:02.613124+01:00"` }
func (MessageSchema) Init ¶
func (message MessageSchema) Init() MessageSchema
type MessageUpdateSchema ¶
type MessagesResponseDataSchema ¶
type MessagesResponseDataSchema struct { PaginatedResponseDataSchema Items []MessageSchema `json:"items"` }
func (MessagesResponseDataSchema) Init ¶
func (data MessagesResponseDataSchema) Init() MessagesResponseDataSchema
type MessagesSchema ¶
type MessagesSchema struct { Chat ChatSchema `json:"chat"` Messages MessagesResponseDataSchema `json:"messages"` Users []*UserDataSchema `json:"users"` }
func (MessagesSchema) Init ¶
func (data MessagesSchema) Init() MessagesSchema
type NotificationSchema ¶
type NotificationSchema struct { Edges *ent.NotificationEdges `json:"edges,omitempty" swaggerignore:"true"` ID uuid.UUID `json:"id"` Sender *UserDataSchema `json:"sender"` Ntype string `json:"ntype" example:"REACTION"` Text *string `json:"text,omitempty" swaggerignore:"true"` Message string `json:"message" example:"John Doe reacted to your post"` PostSlug *string `json:"post_slug" example:"john-doe-d10dde64-a242-4ed0-bd75-4c759644b3a6"` CommentSlug *string `json:"comment_slug" example:"john-doe-d10dde64-a242-4ed0-bd75-4c759644b3a6"` ReplySlug *string `json:"reply_slug" example:"john-doe-d10dde64-a242-4ed0-bd75-4c759644b3a6"` IsRead bool `json:"is_read" example:"true"` }
func (NotificationSchema) GetMessage ¶
func (notification NotificationSchema) GetMessage() string
func (NotificationSchema) Init ¶
func (notification NotificationSchema) Init(currentUserID *uuid.UUID) NotificationSchema
func (NotificationSchema) SetTargetSlug ¶
func (notification NotificationSchema) SetTargetSlug() NotificationSchema
type NotificationsResponseDataSchema ¶
type NotificationsResponseDataSchema struct { PaginatedResponseDataSchema Items []NotificationSchema `json:"notifications"` }
NOTIFICATIONS
func (NotificationsResponseDataSchema) Init ¶
func (data NotificationsResponseDataSchema) Init(currentUserID uuid.UUID) NotificationsResponseDataSchema
type NotificationsResponseSchema ¶
type NotificationsResponseSchema struct { ResponseSchema Data NotificationsResponseDataSchema `json:"data"` }
type PostInputResponseDataSchema ¶
type PostInputResponseDataSchema struct { PostSchema Image *string `json:"image,omitempty" swaggerignore:"true"` // Remove image during create & update FileUploadData *utils.SignatureFormat `json:"file_upload_data"` }
func (PostInputResponseDataSchema) Init ¶
func (postData PostInputResponseDataSchema) Init(fileType *string) PostInputResponseDataSchema
type PostInputResponseSchema ¶
type PostInputResponseSchema struct { ResponseSchema Data PostInputResponseDataSchema `json:"data"` }
type PostInputSchema ¶
type PostResponseSchema ¶
type PostResponseSchema struct { ResponseSchema Data PostSchema `json:"data"` }
type PostSchema ¶
type PostSchema struct { Edges *ent.PostEdges `json:"edges,omitempty" swaggerignore:"true"` Author UserDataSchema `json:"author"` Text string `json:"text" example:"God Is Good"` Slug string `json:"slug" example:"john-doe-d10dde64-a242-4ed0-bd75-4c759644b3a6"` ReactionsCount uint `json:"reactions_count" example:"200"` CommentsCount uint `json:"comments_count" example:"35"` Image *string `json:"image" example:"https://img.url"` CreatedAt time.Time `json:"created_at" example:"2024-01-14T19:00:02.613124+01:00"` UpdatedAt time.Time `json:"updated_at" example:"2024-01-14T19:00:02.613124+01:00"` }
func (PostSchema) Init ¶
func (post PostSchema) Init() PostSchema
type PostsResponseDataSchema ¶
type PostsResponseDataSchema struct { PaginatedResponseDataSchema Items []PostSchema `json:"posts"` }
RESPONSE SCHEMAS POSTS
func (PostsResponseDataSchema) Init ¶
func (data PostsResponseDataSchema) Init() PostsResponseDataSchema
type PostsResponseSchema ¶
type PostsResponseSchema struct { ResponseSchema Data PostsResponseDataSchema `json:"data"` }
type ProfileResponseSchema ¶
type ProfileResponseSchema struct { ResponseSchema Data ProfileSchema `json:"data"` }
type ProfileSchema ¶
type ProfileSchema struct { Edges *ent.UserEdges `json:"edges,omitempty" swaggerignore:"true"` FirstName string `json:"first_name" example:"John"` LastName string `json:"last_name" example:"Doe"` Username string `json:"username" example:"john-doe"` Email string `json:"email" example:"johndoe@email.com"` Avatar *string `json:"avatar" example:"https://img.com"` Bio *string `json:"bio" example:"Software Engineer | Go Fiber Developer"` Dob *time.Time `json:"dob"` City *string `json:"city" example:"Lekki"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` }
func (ProfileSchema) Init ¶
func (user ProfileSchema) Init() ProfileSchema
type ProfileUpdateResponseDataSchema ¶
type ProfileUpdateResponseDataSchema struct { ProfileSchema FileUploadData *utils.SignatureFormat `json:"file_upload_data"` }
func (ProfileUpdateResponseDataSchema) Init ¶
func (profileData ProfileUpdateResponseDataSchema) Init(fileType *string) ProfileUpdateResponseDataSchema
type ProfileUpdateResponseSchema ¶
type ProfileUpdateResponseSchema struct { ResponseSchema Data ProfileUpdateResponseDataSchema `json:"data"` }
type ProfileUpdateSchema ¶
type ProfileUpdateSchema struct { FirstName *string `json:"first_name" validate:"omitempty,max=50,min=1" example:"John"` LastName *string `json:"last_name" validate:"omitempty,max=50,min=1" example:"Doe"` Bio *string `json:"bio" validate:"omitempty,max=200" example:"Software Engineer | Go Fiber Developer"` Dob *time.Time `json:"dob" validate:"omitempty" example:"2001-01-16T00:00:00.106416+01:00"` CityID *uuid.UUID `json:"city_id" validate:"omitempty" example:"d10dde64-a242-4ed0-bd75-4c759644b3a6"` FileType *string `json:"file_type" example:"image/jpeg" validate:"omitempty,file_type_validator"` City *ent.City `json:"-"` }
type ProfilesResponseDataSchema ¶
type ProfilesResponseDataSchema struct { PaginatedResponseDataSchema Items []ProfileSchema `json:"users"` }
USERS
func (ProfilesResponseDataSchema) Init ¶
func (data ProfilesResponseDataSchema) Init() ProfilesResponseDataSchema
type ProfilesResponseSchema ¶
type ProfilesResponseSchema struct { ResponseSchema Data ProfilesResponseDataSchema `json:"data"` }
type ReactionInputSchema ¶
type ReactionResponseSchema ¶
type ReactionResponseSchema struct { ResponseSchema Data ReactionSchema `json:"data"` }
type ReactionSchema ¶
type ReactionSchema struct { Edges *ent.ReactionEdges `json:"edges,omitempty" swaggerignore:"true"` ID uuid.UUID `json:"id" example:"d10dde64-a242-4ed0-bd75-4c759644b3a6"` User UserDataSchema `json:"user"` Rtype string `json:"rtype" example:"LIKE"` }
REACTION SCHEMA
func (ReactionSchema) Init ¶
func (reaction ReactionSchema) Init() ReactionSchema
type ReactionsResponseDataSchema ¶
type ReactionsResponseDataSchema struct { PaginatedResponseDataSchema Items []ReactionSchema `json:"reactions"` }
REACTIONS
func (ReactionsResponseDataSchema) Init ¶
func (data ReactionsResponseDataSchema) Init() ReactionsResponseDataSchema
type ReactionsResponseSchema ¶
type ReactionsResponseSchema struct { ResponseSchema Data ReactionsResponseDataSchema `json:"data"` }
type ReadNotificationSchema ¶
type RefreshTokenSchema ¶
type RefreshTokenSchema struct {
Refresh string `` /* 172-byte string literal not displayed */
}
type RegisterResponseSchema ¶
type RegisterResponseSchema struct { ResponseSchema Data EmailRequestSchema `json:"data"` }
RESPONSE BODY SCHEMAS
type RegisterUser ¶
type RegisterUser struct { FirstName string `json:"first_name" validate:"required,max=50" example:"John"` LastName string `json:"last_name" validate:"required,max=50" example:"Doe"` Email string `json:"email" validate:"required,min=5,email" example:"johndoe@email.com"` Password string `json:"password" validate:"required,min=8,max=50" example:"strongpassword"` TermsAgreement bool `json:"terms_agreement" validate:"eq=true"` }
REQUEST BODY SCHEMAS
type ReplyResponseSchema ¶
type ReplyResponseSchema struct { ResponseSchema Data ReplySchema `json:"data"` }
type ReplySchema ¶
type ReplySchema struct { Edges *ent.ReplyEdges `json:"edges,omitempty" swaggerignore:"true"` Author UserDataSchema `json:"author"` Slug string `json:"slug" example:"john-doe-d10dde64-a242-4ed0-bd75-4c759644b3a6"` Text string `json:"text" example:"Jesus Is King"` ReactionsCount uint `json:"reactions_count" example:"200"` }
COMMENTS & REPLIES SCHEMA
func (ReplySchema) Init ¶
func (reply ReplySchema) Init() ReplySchema
type ResponseSchema ¶
type ResponseSchema struct { Status string `json:"status" example:"success"` Message string `json:"message" example:"Data fetched/created/updated/deleted"` }
func (ResponseSchema) Init ¶
func (obj ResponseSchema) Init() ResponseSchema
type SendFriendRequestSchema ¶
type SendFriendRequestSchema struct {
Username string `json:"username" validate:"required" example:"john-doe"`
}
type SetNewPasswordSchema ¶
type SetNewPasswordSchema struct { VerifyEmailRequestSchema Password string `json:"password" validate:"required,min=8,max=50" example:"newstrongpassword"` }
type SiteDetail ¶
type SiteDetail struct { Name string `json:"name" example:"SocialNet"` Email string `json:"email" example:"johndoe@email.com"` Phone string `json:"phone" example:"+2348133831036"` Address string `json:"address" example:"234, Lagos, Nigeria"` Fb string `json:"fb" example:"https://facebook.com"` Tw string `json:"tw" example:"https://twitter.com"` Wh string `json:"wh" example:"https://wa.me/2348133831036"` Ig string `json:"ig" example:"https://instagram.com"` }
type SiteDetailResponseSchema ¶
type SiteDetailResponseSchema struct { ResponseSchema Data SiteDetail `json:"data"` }
type TokensResponseSchema ¶
type UserDataSchema ¶
type UserDataSchema struct { Name string `json:"name" example:"John Doe"` Username string `json:"username" example:"john-doe"` Avatar *string `json:"avatar" example:"https://img.url"` }
func ConvertUsers ¶
func ConvertUsers(users []*ent.User) []*UserDataSchema
func (UserDataSchema) Init ¶
func (user UserDataSchema) Init(userObj *ent.User) UserDataSchema
Source Files
¶
Click to show internal directories.
Click to hide internal directories.