amqp_trigger

package
v0.0.0-...-f514c2e Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

AMQP Trigger

Start a simple consumer to get messages from an AMQP message queue.

Config

Example config:

username = "guest"
password = "guest"
domain = "amqp://localhost" # make sure to include amqp:// or amqps://
port = "5672"

queueName = "queue-a"
consumerName = "trigger"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Username   string
	Password   string
	AmqpScheme string
	Domain     string
	Port       string

	QueueName    string
	ConsumerName string // if nil the server will give a name
}

type Trigger

type Trigger struct {
	RequestChannel     chan *domain.Request
	ResponseChannelMap *sync.Map
	// contains filtered or unexported fields
}

func NewTrigger

func NewTrigger() *Trigger

func (*Trigger) Close

func (t *Trigger) Close() error

func (*Trigger) Init

func (t *Trigger) Init(stub domain.Stub, config []byte) error

func (*Trigger) NextMessage

func (t *Trigger) NextMessage() (tag string, message map[string]interface{}, err error)

func (*Trigger) Respond

func (t *Trigger) Respond(tag string, response map[string]interface{}, err error) error

Jump to

Keyboard shortcuts

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