mq

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitChatMQ

func InitChatMQ()

func InitRabbitMQ

func InitRabbitMQ()

Types

type ChatMQ

type ChatMQ struct {
	RabbitMQ
	// contains filtered or unexported fields
}
var ChatMQCli *ChatMQ

func NewChatMQ

func NewChatMQ(queueName string) *ChatMQ

func (*ChatMQ) Consumer

func (r *ChatMQ) Consumer()

func (*ChatMQ) DealWithMessageToUser

func (c *ChatMQ) DealWithMessageToUser(msg <-chan amqp.Delivery)

func (*ChatMQ) Publish

func (c *ChatMQ) Publish(ctx context.Context, message string) error

type Message

type Message struct {
	Id         int64
	ToUserId   int64
	FromUserId int64
	Content    string
	CreatedAt  time.Time
	UpdatedAt  time.Time
	DeletedAt  gorm.DeletedAt `gorm:"index"`
}

type MiddleMessage

type MiddleMessage struct {
	Id         int64
	ToUserId   int64
	FromUserId int64
	Content    string
	IsReadNum  []int64
	CreatedAt  string
}

type RabbitMQ

type RabbitMQ struct {
	// contains filtered or unexported fields
}
var (
	Rmq *RabbitMQ
	Mu  sync.Mutex
)

Jump to

Keyboard shortcuts

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