queue

package
v0.0.0-...-8103b37 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActAddReply = 1 + iota
	ActDelReply
	ActLikeReply
	ActDislikeReply
	ActPinReply
)
View Source
const (
	ActionUndo = 0
	ActionDo   = 1
)
View Source
const (
	LikeType    = 0
	DisLikeType = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddReplyData

type AddReplyData comm.Model

发表评论所需数据

type BinaryReplyData

type BinaryReplyData struct {
	Uid     uint64 `json:"uid"`
	ReplyId uint64 `json:"reply_id"`
	Action  int    `json:"action"` // do or undo
	Type    int    `json:"type"`   // like or dislike
}

type Bus

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

func New

func New(c *config.Config) *Bus

func (*Bus) AddReply

func (b *Bus) AddReply(ctx context.Context, data *comm.Model) error

func (*Bus) DelReply

func (b *Bus) DelReply(ctx context.Context, rid uint64, reply *comm.Model) error

func (*Bus) DisLikeReply

func (b *Bus) DisLikeReply(ctx context.Context, rid, uid uint64) error

func (*Bus) LikeReply

func (b *Bus) LikeReply(ctx context.Context, rid, uid uint64) error

func (*Bus) PinReply

func (b *Bus) PinReply(ctx context.Context, oid, rid uint64) error

置顶评论

func (*Bus) UnDisLikeReply

func (b *Bus) UnDisLikeReply(ctx context.Context, rid, uid uint64) error

func (*Bus) UnLikeReply

func (b *Bus) UnLikeReply(ctx context.Context, rid, uid uint64) error

func (*Bus) UnPinReply

func (b *Bus) UnPinReply(ctx context.Context, oid, rid uint64) error

取消置顶

type Data

type Data struct {
	Action        int              `json:"action"`
	AddReplyData  *AddReplyData    `json:"add_reply_data,omitempty"`
	DelReplyData  *DelReplyData    `json:"del_reply_data,omitempty"`
	LikeReplyData *BinaryReplyData `json:"like_reply_data,omitempty"`
	PinReplyData  *PinReplyData    `json:"pin_reply_data,omitempty"`
}

放进消息队列中的数据

type DelReplyData

type DelReplyData struct {
	ReplyId uint64      `json:"reply_id"`
	Reply   *comm.Model `json:"reply"`
}

删除评论所需数据

type PinReplyData

type PinReplyData struct {
	ReplyId uint64 `json:"reply_id"`
	Action  int    `json:"action"` // do or undo
	Oid     uint64 `json:"oid"`
}

Jump to

Keyboard shortcuts

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