amqp_interface

package
v0.0.0-...-66f2672 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Run

func Run(cfg *config.Config)

Types

type ConnectionInfo

type ConnectionInfo struct {
	Host        string
	Port        string
	Username    string
	Secret      string
	VirtualHost string
}

type MessageBus

type MessageBus struct {
	ExchangeName string
	ExchangeType string
	QueueName    string
	ConsumerName string
	RoutingKey   string
	HandlerFunc  func(amqp.Delivery)
}

type MessagingClient

type MessagingClient struct {
	Events    MessageBus
	Commands  MessageBus
	Connector ConnectionInfo
	// contains filtered or unexported fields
}

MessagingClient - Real implementation, encapsulates a pointer to an amqp.Connection

var Service *MessagingClient

func (*MessagingClient) Close

func (m *MessagingClient) Close()

Close the connectiont o rabbitMQ

func (*MessagingClient) ConnectToBroker

func (m *MessagingClient) ConnectToBroker()

ConnectToBroker - Connects to the given RabbitMQ URL string

func (*MessagingClient) HandleAMQPCommandEvents

func (m *MessagingClient) HandleAMQPCommandEvents(d amqp.Delivery)

HandleAMQPCommandEvents - Retrieve Pusblished AMQP Event here

func (*MessagingClient) Publish

func (m *MessagingClient) Publish(body []byte, exchangeName string, exchangeType string, queueName string, routingKey string) error

Publish - Pusblish the given Body into the given exchange details

func (*MessagingClient) PublishEvent

func (m *MessagingClient) PublishEvent(body []byte) error

func (*MessagingClient) PublishOnQueue

func (m *MessagingClient) PublishOnQueue(body []byte, queueName string) error

PublishOnQueue - Sends the Body to a Queue Directly !

func (*MessagingClient) ReplyError

func (m *MessagingClient) ReplyError(error_msg string, jsonrpc_id interface{})

func (*MessagingClient) ReplyOK

func (m *MessagingClient) ReplyOK(jsonrpc_id interface{}, cmd_id string)

func (*MessagingClient) StartAMQPListener

func (m *MessagingClient) StartAMQPListener()

func (*MessagingClient) Subscribe

func (m *MessagingClient) Subscribe(exchangeName string, exchangeType string, routingKey string, queueName string, handlerFunc func(amqp.Delivery)) error

Subscribe - Subscribe for events happening in a particular exchnage

func (*MessagingClient) SubscribeToQueue

func (m *MessagingClient) SubscribeToQueue(queueName string, consumerName string, handlerFunc func(amqp.Delivery)) error

SubscribeToQueue - Subscribe messages coming to a particular queue directly !

type ReceivedCommand

type ReceivedCommand struct {
	Type      string                 `json:"Event-Name"`
	Timestamp int                    `json:"Event-Date-Local"`
	UUID      string                 `json:"id"`
	Headers   map[string]interface{} `json:"Header"`
	Body      interface{}            `json:"Body"`
}

type WSCmdEvent

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

Jump to

Keyboard shortcuts

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