Documentation ¶
Index ¶
- func NewFactory(md *trigger.Metadata) trigger.Factory
- type AMQPExchange
- func (exch *AMQPExchange) Close() error
- func (exch *AMQPExchange) Open(isQueued bool) error
- func (exch *AMQPExchange) PrepareReceiveFunc(f func(msgs <-chan amqp.Delivery)) error
- func (exch *AMQPExchange) Publish(body string) error
- func (exch *AMQPExchange) PublishObject(obj interface{}) error
- func (exch *AMQPExchange) ReadMessages() ([]string, error)
- type AMQPFactory
- type AmqpTrigger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AMQPExchange ¶
type AMQPExchange struct { Uri string HostName string ExchangeName string ExchangeType string QueueName string RoutingKey string UserName string Password string Durable bool AutoDelete bool Reliable bool Connection *amqp.Connection Channel *amqp.Channel Queue *amqp.Queue Messages []string Confirms chan amqp.Confirmation IsOpen bool }
AMQPExchange contains all parameters required to create or open an exchenge
func AMQPExchangeNew ¶
func AMQPExchangeNew(hostName string, port int, exchangeName string, exchangeType string, queueName string, routingKey string, userName string, password string, durable bool, autoDelete bool, reliable bool) *AMQPExchange
AMQPExchangeNew creates a new exchange in the Broker
func (*AMQPExchange) Open ¶
func (exch *AMQPExchange) Open(isQueued bool) error
Open opens a previosly created Exchange
func (*AMQPExchange) PrepareReceiveFunc ¶
func (exch *AMQPExchange) PrepareReceiveFunc(f func(msgs <-chan amqp.Delivery)) error
PrepareReceiveFunc Prepares exchange/queue to receive messages
func (*AMQPExchange) Publish ¶
func (exch *AMQPExchange) Publish(body string) error
Publish publishes a new message into an existing exchange
func (*AMQPExchange) PublishObject ¶
func (exch *AMQPExchange) PublishObject(obj interface{}) error
PublishObject serializes objects (JSON) and publish to existing exchange
func (*AMQPExchange) ReadMessages ¶
func (exch *AMQPExchange) ReadMessages() ([]string, error)
ReadMessages reads the messajes accumulated in the queue
type AMQPFactory ¶
type AMQPFactory struct {
// contains filtered or unexported fields
}
AMQPFactory AMQP Trigger factory
type AmqpTrigger ¶
type AmqpTrigger struct {
// contains filtered or unexported fields
}
AmqpTrigger is simple AMQP trigger
func (*AmqpTrigger) Initialize ¶
func (t *AmqpTrigger) Initialize(ctx trigger.InitContext) error
Initialize implements trigger.Initializable.Initialize
func (*AmqpTrigger) Metadata ¶
func (t *AmqpTrigger) Metadata() *trigger.Metadata
Metadata implements trigger.Trigger.Metadata
func (*AmqpTrigger) RunHandler ¶
func (t *AmqpTrigger) RunHandler(handler *trigger.Handler, payload string)
RunHandler runs the handler and associated action
func (*AmqpTrigger) Start ¶
func (t *AmqpTrigger) Start() error
Start implements trigger.Trigger.Start