Documentation ¶
Overview ¶
Package amqp implements an AMQP binding using pack.ag/amqp module
Index ¶
- func NewReceiver(amqp *amqp.Receiver) protocol.Receiver
- func NewSender(amqpSender *amqp.Sender, options ...SenderOptionFunc) protocol.Sender
- func WriteMessage(ctx context.Context, m binding.Message, amqpMessage *amqp.Message, ...) error
- type Message
- func (m *Message) Finish(err error) error
- func (m *Message) GetAttribute(k spec.Kind) (spec.Attribute, interface{})
- func (m *Message) GetExtension(name string) interface{}
- func (m *Message) ReadBinary(ctx context.Context, encoder binding.BinaryWriter) error
- func (m *Message) ReadEncoding() binding.Encoding
- func (m *Message) ReadStructured(ctx context.Context, encoder binding.StructuredWriter) error
- type Option
- type Protocol
- type SenderOptionFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewReceiver ¶
NewReceiver create a new Receiver which wraps an amqp.Receiver in a binding.Receiver
func NewSender ¶
func NewSender(amqpSender *amqp.Sender, options ...SenderOptionFunc) protocol.Sender
NewSender creates a new Sender which wraps an amqp.Sender in a binding.Sender
func WriteMessage ¶
func WriteMessage(ctx context.Context, m binding.Message, amqpMessage *amqp.Message, transformers ...binding.Transformer) error
WriteMessage fills the provided amqpMessage with the message m. Using context you can tweak the encoding processing (more details on binding.Write documentation).
Types ¶
type Message ¶
type Message struct { AMQP *amqp.Message // contains filtered or unexported fields }
Message implements binding.Message by wrapping an *amqp.Message. This message *can* be read several times safely
func NewMessage ¶
func NewMessage(message *amqp.Message) *Message
NewMessage wrap an *amqp.Message in a binding.Message. The returned message *can* be read several times safely
func (*Message) GetAttribute ¶
func (*Message) GetExtension ¶
func (*Message) ReadBinary ¶
func (*Message) ReadEncoding ¶
func (*Message) ReadStructured ¶
type Option ¶
Option is the function signature required to be considered an amqp.Option.
func WithConnOpt ¶
func WithConnOpt(opt amqp.ConnOption) Option
WithConnOpt sets a connection option for amqp
func WithConnSASLPlain ¶
WithConnSASLPlain sets SASLPlain connection option for amqp
func WithReceiverLinkOption ¶
func WithReceiverLinkOption(opt amqp.LinkOption) Option
WithReceiverLinkOption sets a link option for amqp
func WithSenderLinkOption ¶
func WithSenderLinkOption(opt amqp.LinkOption) Option
WithSenderLinkOption sets a link option for amqp
func WithSessionOpt ¶
func WithSessionOpt(opt amqp.SessionOption) Option
WithSessionOpt sets a session option for amqp
type Protocol ¶
type Protocol struct { // AMQP Client *amqp.Client Session *amqp.Session Node string // Sender Sender *sender SenderContextDecorators []func(context.Context) context.Context // Receiver Receiver *receiver // contains filtered or unexported fields }
func NewProtocol ¶
func NewProtocol(server, queue string, connOption []amqp.ConnOption, sessionOption []amqp.SessionOption, opts ...Option) (*Protocol, error)
NewProtocol creates a new amqp transport.
type SenderOptionFunc ¶
type SenderOptionFunc func(sender *sender)
SenderOptionFunc is the type of amqp.Sender options