Documentation
¶
Index ¶
- Constants
- type CommentMessage
- type CommentType
- type GetVotesResult
- type ModeratorAttention
- type RatingFan
- type RatingUser
- type Repository
- func (s *Repository) Add(ctx context.Context, typeID CommentType, itemID int64, parentID int64, ...) (int64, error)
- func (s *Repository) AssertItem(ctx context.Context, typeID CommentType, itemID int64) error
- func (s *Repository) AuthorsFans(ctx context.Context, userID int64, limit uint) ([]RatingFan, error)
- func (s *Repository) CleanBrokenMessages(ctx context.Context) (int64, error)
- func (s *Repository) CleanTopics(ctx context.Context) (int64, error)
- func (s *Repository) CleanupDeleted(ctx context.Context) (int64, error)
- func (s *Repository) CompleteMessage(ctx context.Context, id int64) error
- func (s *Repository) Count(ctx context.Context, attention ModeratorAttention, commentType CommentType, ...) (int32, error)
- func (s *Repository) GetCommentType(ctx context.Context, commentID int64) (CommentType, error)
- func (s *Repository) GetVotes(ctx context.Context, id int64) (*GetVotesResult, error)
- func (s *Repository) IsNewMessage(ctx context.Context, typeID CommentType, itemID int64, msgTime time.Time, ...) (bool, error)
- func (s *Repository) IsSubscribed(ctx context.Context, userID int64, commentsType CommentType, itemID int64) (bool, error)
- func (s *Repository) Message(ctx context.Context, messageID int64, fetchMessage bool, fetchVote bool, ...) (*CommentMessage, error)
- func (s *Repository) MessagePage(ctx context.Context, messageID int64, perPage int32) (int64, CommentType, int32, error)
- func (s *Repository) MessageRowRoute(ctx context.Context, typeID CommentType, itemID int64, messageID int64) ([]string, error)
- func (s *Repository) MessagesCountFromTimestamp(ctx context.Context, typeID CommentType, itemID int64, timestamp time.Time) (int32, error)
- func (s *Repository) MoveMessage(ctx context.Context, commentID int64, dstType CommentType, dstItemID int64) error
- func (s *Repository) NeedWait(ctx context.Context, userID int64) (bool, error)
- func (s *Repository) NotifyAboutReply(ctx context.Context, messageID int64) error
- func (s *Repository) NotifySubscribers(ctx context.Context, messageID int64) error
- func (s *Repository) Paginator(request Request) *util.Paginator
- func (s *Repository) QueueDeleteMessage(ctx context.Context, commentID int64, byUserID int64) error
- func (s *Repository) RefreshRepliesCount(ctx context.Context) (int64, error)
- func (s *Repository) RestoreMessage(ctx context.Context, commentID int64) error
- func (s *Repository) SetSubscriptionSent(ctx context.Context, typeID CommentType, itemID int64, subscriberID int64, ...) error
- func (s *Repository) Subscribe(ctx context.Context, userID int64, commentsType CommentType, itemID int64) error
- func (s *Repository) TopAuthors(ctx context.Context, limit uint) ([]RatingUser, error)
- func (s *Repository) TopicStat(ctx context.Context, typeID CommentType, itemID int64) (int32, error)
- func (s *Repository) TopicStatForUser(ctx context.Context, typeID CommentType, itemID int64, userID int64) (int32, int32, error)
- func (s *Repository) UnSubscribe(ctx context.Context, userID int64, commentsType CommentType, itemID int64) error
- func (s *Repository) UpdateMessageRepliesCount(ctx context.Context, messageID int64) error
- func (s *Repository) UpdateTopicView(ctx context.Context, typeID CommentType, itemID int64, userID int64) error
- func (s *Repository) UserVote(ctx context.Context, userID int64, commentID int64) (int32, error)
- func (s *Repository) View(ctx context.Context, userID int64, commentsType CommentType, itemID int64) error
- func (s *Repository) VoteComment(ctx context.Context, userID int64, commentID int64, vote int32) (int32, error)
- type Request
Constants ¶
View Source
const CommentMessagePreviewLength = 60
View Source
const MaxMessageLength = 16 * 1024
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommentMessage ¶ added in v1.41.0
type CommentMessage struct { ID int64 `db:"id"` TypeID CommentType `db:"type_id"` ItemID int64 `db:"item_id"` ParentID sql.NullInt64 `db:"parent_id"` CreatedAt time.Time `db:"datetime"` Deleted bool `db:"deleted"` ModeratorAttention ModeratorAttention `db:"moderator_attention"` AuthorID sql.NullInt64 `db:"author_id"` IP net.IP `db:"ip"` Message string `db:"message"` Vote int32 `db:"vote"` }
type CommentType ¶
type CommentType int32
const ( TypeIDPictures CommentType = 1 TypeIDItems CommentType = 2 TypeIDVotings CommentType = 3 TypeIDArticles CommentType = 4 TypeIDForums CommentType = 5 )
type GetVotesResult ¶
type ModeratorAttention ¶
type ModeratorAttention int32
const ( ModeratorAttentionNone ModeratorAttention = 0 ModeratorAttentionRequired ModeratorAttention = 1 ModeratorAttentionCompleted ModeratorAttention = 2 )
type RatingUser ¶ added in v1.75.0
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository Main Object.
func NewRepository ¶
func NewRepository( db *goqu.Database, userRepository *users.Repository, messageRepository *messaging.Repository, hostManager *hosts.Manager, i18n *i18nbundle.I18n, ) *Repository
NewRepository constructor.
func (*Repository) AssertItem ¶ added in v1.18.0
func (s *Repository) AssertItem(ctx context.Context, typeID CommentType, itemID int64) error
func (*Repository) AuthorsFans ¶ added in v1.76.0
func (*Repository) CleanBrokenMessages ¶ added in v1.26.0
func (s *Repository) CleanBrokenMessages(ctx context.Context) (int64, error)
func (*Repository) CleanTopics ¶ added in v1.27.0
func (s *Repository) CleanTopics(ctx context.Context) (int64, error)
func (*Repository) CleanupDeleted ¶ added in v1.18.0
func (s *Repository) CleanupDeleted(ctx context.Context) (int64, error)
func (*Repository) CompleteMessage ¶ added in v1.18.0
func (s *Repository) CompleteMessage(ctx context.Context, id int64) error
func (*Repository) Count ¶ added in v1.67.0
func (s *Repository) Count( ctx context.Context, attention ModeratorAttention, commentType CommentType, itemID int64, ) (int32, error)
func (*Repository) GetCommentType ¶
func (s *Repository) GetCommentType(ctx context.Context, commentID int64) (CommentType, error)
func (*Repository) GetVotes ¶
func (s *Repository) GetVotes(ctx context.Context, id int64) (*GetVotesResult, error)
func (*Repository) IsNewMessage ¶ added in v1.41.0
func (s *Repository) IsNewMessage( ctx context.Context, typeID CommentType, itemID int64, msgTime time.Time, userID int64, ) (bool, error)
func (*Repository) IsSubscribed ¶ added in v1.37.0
func (s *Repository) IsSubscribed( ctx context.Context, userID int64, commentsType CommentType, itemID int64, ) (bool, error)
func (*Repository) Message ¶ added in v1.41.0
func (s *Repository) Message( ctx context.Context, messageID int64, fetchMessage bool, fetchVote bool, canViewIP bool, ) (*CommentMessage, error)
func (*Repository) MessagePage ¶ added in v1.38.0
func (s *Repository) MessagePage( ctx context.Context, messageID int64, perPage int32, ) (int64, CommentType, int32, error)
func (*Repository) MessageRowRoute ¶ added in v1.41.0
func (s *Repository) MessageRowRoute( ctx context.Context, typeID CommentType, itemID int64, messageID int64, ) ([]string, error)
func (*Repository) MessagesCountFromTimestamp ¶ added in v1.37.0
func (s *Repository) MessagesCountFromTimestamp( ctx context.Context, typeID CommentType, itemID int64, timestamp time.Time, ) (int32, error)
func (*Repository) MoveMessage ¶
func (s *Repository) MoveMessage(ctx context.Context, commentID int64, dstType CommentType, dstItemID int64) error
func (*Repository) NotifyAboutReply ¶ added in v1.19.0
func (s *Repository) NotifyAboutReply(ctx context.Context, messageID int64) error
func (*Repository) NotifySubscribers ¶ added in v1.18.0
func (s *Repository) NotifySubscribers(ctx context.Context, messageID int64) error
func (*Repository) Paginator ¶ added in v1.41.0
func (s *Repository) Paginator(request Request) *util.Paginator
func (*Repository) QueueDeleteMessage ¶
func (*Repository) RefreshRepliesCount ¶ added in v1.18.0
func (s *Repository) RefreshRepliesCount(ctx context.Context) (int64, error)
func (*Repository) RestoreMessage ¶
func (s *Repository) RestoreMessage(ctx context.Context, commentID int64) error
func (*Repository) SetSubscriptionSent ¶ added in v1.41.0
func (s *Repository) SetSubscriptionSent( ctx context.Context, typeID CommentType, itemID int64, subscriberID int64, sent bool, ) error
func (*Repository) Subscribe ¶
func (s *Repository) Subscribe(ctx context.Context, userID int64, commentsType CommentType, itemID int64) error
func (*Repository) TopAuthors ¶ added in v1.75.0
func (s *Repository) TopAuthors(ctx context.Context, limit uint) ([]RatingUser, error)
func (*Repository) TopicStat ¶ added in v1.37.0
func (s *Repository) TopicStat(ctx context.Context, typeID CommentType, itemID int64) (int32, error)
func (*Repository) TopicStatForUser ¶ added in v1.37.0
func (s *Repository) TopicStatForUser( ctx context.Context, typeID CommentType, itemID int64, userID int64, ) (int32, int32, error)
func (*Repository) UnSubscribe ¶
func (s *Repository) UnSubscribe(ctx context.Context, userID int64, commentsType CommentType, itemID int64) error
func (*Repository) UpdateMessageRepliesCount ¶ added in v1.18.0
func (s *Repository) UpdateMessageRepliesCount(ctx context.Context, messageID int64) error
func (*Repository) UpdateTopicView ¶ added in v1.18.0
func (s *Repository) UpdateTopicView(ctx context.Context, typeID CommentType, itemID int64, userID int64) error
func (*Repository) View ¶
func (s *Repository) View(ctx context.Context, userID int64, commentsType CommentType, itemID int64) error
func (*Repository) VoteComment ¶
Click to show internal directories.
Click to hide internal directories.