comments

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentType

type CommentType int32
const (
	TypeIDPictures CommentType = 1
	TypeIDItems    CommentType = 2
	TypeIDVotings  CommentType = 3
	TypeIDArticles CommentType = 4
	TypeIDForums   CommentType = 5
)

type GetVotesResult

type GetVotesResult struct {
	PositiveVotes []users.DBUser
	NegativeVotes []users.DBUser
}

type ModeratorAttention

type ModeratorAttention int32
const (
	ModeratorAttentionNone      ModeratorAttention = 0
	ModeratorAttentionRequired  ModeratorAttention = 1
	ModeratorAttentionCompleted ModeratorAttention = 2
)

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,
) *Repository

NewRepository constructor.

func (*Repository) Add added in v1.18.0

func (s *Repository) Add(
	ctx context.Context,
	typeID CommentType,
	itemID int64,
	parentID int64,
	userID int64,
	message string,
	addr string,
	attention bool,
) (int64, error)

func (*Repository) AssertItem added in v1.18.0

func (s *Repository) AssertItem(ctx context.Context, typeID CommentType, itemID 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) 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) MoveMessage

func (s *Repository) MoveMessage(ctx context.Context, commentID int64, dstType CommentType, dstItemID int64) error

func (*Repository) NeedWait added in v1.19.0

func (s *Repository) NeedWait(ctx context.Context, userID int64) (bool, 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) QueueDeleteMessage

func (s *Repository) QueueDeleteMessage(ctx context.Context, commentID int64, byUserID int64) error

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) Subscribe

func (s *Repository) Subscribe(ctx context.Context, userID int64, commentsType CommentType, itemID int64) 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

func (s *Repository) VoteComment(ctx context.Context, userID int64, commentID int64, vote int32) (int32, error)

Jump to

Keyboard shortcuts

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