message_queue

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Index

Constants

This section is empty.

Variables

View Source
var (
	TopicSendEmail   Topic       = "send_email"
	ChanelSendEmail  Chanel      = "send_email"
	TopicPushNotify  Topic       = "push_notify"
	ChanelPushNotify Chanel      = "push_notify"
	Address          string      // 消息队列地址
	Config           *nsq.Config // 消息队列的配置
)

Functions

func CreateConsumer

func CreateConsumer(topic Topic, channel Chanel, handler nsq.Handler) (c *nsq.Consumer, err error)

创建消费者

func Publish

func Publish(topic Topic, message []byte) (err error)

发布消息

func RunMessageQueueConsumer

func RunMessageQueueConsumer() ([]*nsq.Consumer, error)

Types

type Chanel

type Chanel string

type SendActivationEmailBody

type SendActivationEmailBody struct {
	Email string `json:"email" valid:"required~请输入邮箱"` // 要发送的邮箱
	Code  string `json:"code" valid:"required~请输入激活码"` // 发送的激活码
}

type SendNotifyBody added in v0.4.1

type SendNotifyBody struct {
	Event   notify.SendNotifyEvent `json:"event" valid:"required~请输入事件"`    // 事件名称
	Payload interface{}            `json:"payload" valid:"required~请输入数据体"` // 数据体
}

func (*SendNotifyBody) ToByte added in v0.4.1

func (c *SendNotifyBody) ToByte() ([]byte, error)

type Topic

type Topic string

Jump to

Keyboard shortcuts

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