stores

package
v0.0.0-...-0329133 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentStore

type CommentStore struct {
	// contains filtered or unexported fields
}

func (*CommentStore) CancelDislikeComment

func (store *CommentStore) CancelDislikeComment(uid, commentID uint64) error

func (*CommentStore) CancelLikeComment

func (store *CommentStore) CancelLikeComment(uid, commentID uint64) error

func (*CommentStore) CreateComment

func (store *CommentStore) CreateComment(uid uint64, username string, postID uint64, content string) (uint64, error)

func (*CommentStore) DeleteComment

func (store *CommentStore) DeleteComment(commentID uint64) error

func (*CommentStore) DislikeComment

func (store *CommentStore) DislikeComment(uid, commentID uint64) error

func (*CommentStore) GetCommentInfo

func (store *CommentStore) GetCommentInfo(commentID uint64) (models.CommentInfo, int64, error)

func (*CommentStore) GetCommentList

func (store *CommentStore) GetCommentList(postID uint64) ([]models.CommentInfo, error)

func (*CommentStore) GetCommentUserStatus

func (store *CommentStore) GetCommentUserStatus(uid, commentID uint64) (bool, bool, error)

func (*CommentStore) LikeComment

func (store *CommentStore) LikeComment(uid, commentID uint64) error

func (*CommentStore) UpdateComment

func (store *CommentStore) UpdateComment(commentID uint64, content string) error

func (*CommentStore) ValidateCommentExistence

func (store *CommentStore) ValidateCommentExistence(commentID uint64) (bool, error)

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

func NewFactory

func NewFactory(db *gorm.DB, redisClient *redis.Client, mongoClient *mongo.Client, searchService search.SearchEngineClient) *Factory

func (*Factory) NewCommentStore

func (factory *Factory) NewCommentStore() *CommentStore

func (*Factory) NewFollowStore

func (factory *Factory) NewFollowStore() *FollowStore

func (*Factory) NewPostStore

func (factory *Factory) NewPostStore() *PostStore

func (*Factory) NewReplyStore

func (factory *Factory) NewReplyStore() *ReplyStore

func (*Factory) NewUserStore

func (factory *Factory) NewUserStore() *UserStore

type FollowStore

type FollowStore struct {
	// contains filtered or unexported fields
}

func (*FollowStore) CancelFollowUser

func (store *FollowStore) CancelFollowUser(uid, followedID uint64) error

func (*FollowStore) FollowUser

func (store *FollowStore) FollowUser(uid, followedID uint64) error

func (*FollowStore) GetFollowList

func (store *FollowStore) GetFollowList(userID uint64) ([]models.FollowInfo, error)

func (*FollowStore) GetFollowedsByUID

func (store *FollowStore) GetFollowedsByUID(uid uint64) (int64, error)

func (*FollowStore) GetFollowerList

func (store *FollowStore) GetFollowerList(userID uint64) ([]models.FollowInfo, error)

func (*FollowStore) GetFollowersByUID

func (store *FollowStore) GetFollowersByUID(uid uint64) (int64, error)

type PostStore

type PostStore struct {
	// contains filtered or unexported fields
}

func (*PostStore) CachePostImage

func (store *PostStore) CachePostImage(image []byte) (string, error)

func (*PostStore) CancelFavouritePost

func (store *PostStore) CancelFavouritePost(uid, postID int64) error

func (*PostStore) CancelLikePost

func (store *PostStore) CancelLikePost(uid, postID int64) error

func (*PostStore) CheckCacheImageAvaliable

func (store *PostStore) CheckCacheImageAvaliable(uuid string) (bool, error)

func (*PostStore) CreatePost

func (store *PostStore) CreatePost(uid uint64, ipAddr string, postReqData types.PostCreateBody) (models.PostInfo, error)

func (*PostStore) DeletePost

func (store *PostStore) DeletePost(postID uint64) error

func (*PostStore) FavouritePost

func (store *PostStore) FavouritePost(uid, postID int64) error

func (*PostStore) GetPostInfo

func (store *PostStore) GetPostInfo(postID uint64) (models.PostInfo, int64, int64, error)

func (*PostStore) GetPostList

func (store *PostStore) GetPostList(from string, length int) ([]models.PostInfo, error)

func (*PostStore) GetPostListByUID

func (store *PostStore) GetPostListByUID(uid string) ([]models.PostInfo, error)

func (*PostStore) GetPostUserStatus

func (store *PostStore) GetPostUserStatus(uid, postID int64) (bool, bool, error)

func (*PostStore) LikePost

func (store *PostStore) LikePost(uid, postID int64) error

func (*PostStore) ValidatePostExistence

func (store *PostStore) ValidatePostExistence(postID uint64) (bool, error)

type ReplyStore

type ReplyStore struct {
	// contains filtered or unexported fields
}

func (*ReplyStore) CreateReply

func (store *ReplyStore) CreateReply(uid, commentID uint64, parentReplyID, parentReplyUID *uint64, content string) error

func (*ReplyStore) DeleteReply

func (store *ReplyStore) DeleteReply(uid, replyID uint64) error

func (*ReplyStore) GetReply

func (store *ReplyStore) GetReply(replyID uint64) (models.ReplyInfo, error)

func (*ReplyStore) GetReplyList

func (store *ReplyStore) GetReplyList(commentID uint64) ([]models.ReplyInfo, error)

func (*ReplyStore) UpdateReply

func (store *ReplyStore) UpdateReply(uid, replyID uint64, content string) error

func (*ReplyStore) ValidateReplyExistence

func (store *ReplyStore) ValidateReplyExistence(commentID, parentReplyID uint64) (bool, error)

type UserStore

type UserStore struct {
	// contains filtered or unexported fields
}

func (*UserStore) BanUserToken

func (store *UserStore) BanUserToken(uid uint64, token string) error

func (*UserStore) CreateUserAvaliableToken

func (store *UserStore) CreateUserAvaliableToken(token string, claims *types.BearerTokenClaims) error

func (*UserStore) CreateUserLoginLog

func (store *UserStore) CreateUserLoginLog(userLoginLogInfo *models.UserLoginLog) error

func (*UserStore) GetUserAuthInfoByUsername

func (store *UserStore) GetUserAuthInfoByUsername(username string) (*models.UserAuthInfo, error)

func (*UserStore) GetUserByUID

func (store *UserStore) GetUserByUID(uid uint64) (*models.UserInfo, error)

func (*UserStore) GetUserByUsername

func (store *UserStore) GetUserByUsername(username string) (*models.UserInfo, error)

func (*UserStore) GetUserFavoriteRecord

func (store *UserStore) GetUserFavoriteRecord(uid int64) ([]int64, error)

func (*UserStore) GetUserLikedRecord

func (store *UserStore) GetUserLikedRecord(uid int64) ([]int64, error)

func (*UserStore) IsUserTokenAvaliable

func (store *UserStore) IsUserTokenAvaliable(token string) (bool, error)

func (*UserStore) RegisterUserByUsername

func (store *UserStore) RegisterUserByUsername(username string, salt string, hashedPassword string) error

func (*UserStore) SaveUserAvatarByUID

func (store *UserStore) SaveUserAvatarByUID(uid uint64, fileName string, data []byte) error

func (*UserStore) UpdateUserInfoByUID

func (store *UserStore) UpdateUserInfoByUID(uid uint64, updatedProfile *models.UserInfo) error

func (*UserStore) UpdateUserPasswordByUsername

func (store *UserStore) UpdateUserPasswordByUsername(username string, hashedNewPassword string) error

Jump to

Keyboard shortcuts

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