Documentation ¶
Index ¶
- func SetUpOnceChannel(rabbit *amqp.Connection, exchType string, exchDurable bool, exchName string, ...) (*amqp.Channel, *amqp.Queue, error)
- type AMQP
- func (rabbit *AMQP) IntegratePublish(exch string, queue string, contentType string, correlationId string, ...) bool
- func (rabbit *AMQP) PublishMsg(pi PublishItems) bool
- func (rabbit *AMQP) SetAmqpURL(host string, port int, uname string, pwd string, vhost string)
- func (rabbit *AMQP) SetUpChannel(exchType string, exchDurable bool, exchName string, queueDurable bool, ...) error
- func (rabbit *AMQP) SetUpConnectionAmqp() error
- func (rabbit *AMQP) SetUpConnectionAmqpV2()
- func (rabbit *AMQP) SetupConnectionAmqpAndReconnect() error
- func (rabbit *AMQP) Subscribe(qos int, autoAck bool, routingKey string, exchName string, queueName string) (<-chan amqp.Delivery, error)
- type PublishItems
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetUpOnceChannel ¶
func SetUpOnceChannel(rabbit *amqp.Connection, exchType string, exchDurable bool, exchName string, queueDurable bool, queueName string) (*amqp.Channel, *amqp.Queue, error)
SetUpOnceChannel : Setup the once channel of related connection Params : 1. @c ( Connection struct compiler consist of Connection & Channel of this interface for this AMQP ) -> struct interface 2. @logName ( Writing of the related worker ) -> string 3. @exchaneName ( Exchange AMQP Name ) -> string 4. @queueName ( Queue AMQP Name ) -> string Return : 1. @Chn ( Struct ) -> struct interface
Types ¶
type AMQP ¶
type AMQP struct { MsgBrokerURL string Connection *amqp.Connection ErrConn error Channel *amqp.Channel ErrChannel error Queue *amqp.Queue ErrQueue error ExchangeName string }
Initiate a struct of a connection
func (*AMQP) IntegratePublish ¶
func (rabbit *AMQP) IntegratePublish(exch string, queue string, contentType string, correlationId string, requestBody string) bool
IntegratePublish : publish a message
func (*AMQP) PublishMsg ¶
func (rabbit *AMQP) PublishMsg(pi PublishItems) bool
Publish V2 : publish a message with several new added parameter
func (*AMQP) SetAmqpURL ¶
SetAmqpURL : Build an AMQP URL via config param : nil return : 1. @URL ( Connection string of AMQP for dailing ) -> string
func (*AMQP) SetUpChannel ¶
func (rabbit *AMQP) SetUpChannel(exchType string, exchDurable bool, exchName string, queueDurable bool, queueName string) error
SetUpChannel : Setup the once channel of related connection Params : 1. @c ( Connection struct compiler consist of Connection & Channel of this interface for this AMQP ) -> struct interface 2. @logName ( Writing of the related worker ) -> string 3. @exchaneName ( Exchange AMQP Name ) -> string 4. @queueName ( Queue AMQP Name ) -> string Return : 1. @Chn ( Struct ) -> struct interface
func (*AMQP) SetUpConnectionAmqp ¶
SetUpConnectionAmqp : Setup and initiation of dailing of the connection this will handle AMQP connection and channel of themself param : 1. @rabbitURL ( Rabbit URL of the connection string ) -> string returns : 1. @Conn ( Connection struct compiler consist of Connection & Channel of AMQP ) -> struct interface 2. @error ( Related error ) -> error
func (*AMQP) SetUpConnectionAmqpV2 ¶ added in v1.0.7
func (rabbit *AMQP) SetUpConnectionAmqpV2()
SetUpConnectionAmqp : Setup and initiation of dailing of the connection this will handle AMQP connection and channel of themself param : 1. @rabbitURL ( Rabbit URL of the connection string ) -> string returns : 1. @Conn ( Connection struct compiler consist of Connection & Channel of AMQP ) -> struct interface 2. @error ( Related error ) -> error