queue

package
v0.0.0-...-f6d4ea8 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeConnect    = 1
	EventTypeDisconnect = 2
)

Variables

This section is empty.

Functions

func InitConn

func InitConn(mqurl string) error

func InitEventQueue

func InitEventQueue() error

func InitMessageQueue

func InitMessageQueue() error

func InitPushQueue

func InitPushQueue() error

func PubEvent

func PubEvent(appid, userid, addr string, et int)

func PubMessage

func PubMessage(m proto.Message)

func PubNotification

func PubNotification(m proto.Message)

Types

type Event

type Event struct {
	Type   int    `json:"type"`
	AppId  string `json:"app_id"`
	UserId string `json:"user_id"`
	Addr   string `json:"addr"`
}

type Queue

type Queue struct {
	QueueName    string
	ExchangeName string
	RouterKey    string

	Channel *amqp.Channel
}
var (
	MessageQueue *Queue = nil
	EventQueue   *Queue = nil
	PushQueue    *Queue = nil
)

func NewQueue

func NewQueue(conn *amqp.Connection, exchangeName, queueName, routerKey string) (*Queue, error)

Jump to

Keyboard shortcuts

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