1 package amqp 2 3 import ( 4 "context" 5 6 amqp "github.com/rabbitmq/amqp091-go" 7 ) 8 9 // DecodeRequestFunc extracts a user-domain request object from 10 // an AMQP Delivery object. It is designed to be used in AMQP Subscribers. 11 type DecodeRequestFunc func(context.Context, *amqp.Delivery) (request interface{}, err error) 12 13 // EncodeRequestFunc encodes the passed request object into 14 // an AMQP Publishing object. It is designed to be used in AMQP Publishers. 15 type EncodeRequestFunc func(context.Context, *amqp.Publishing, interface{}) error 16 17 // EncodeResponseFunc encodes the passed response object to 18 // an AMQP Publishing object. It is designed to be used in AMQP Subscribers. 19 type EncodeResponseFunc func(context.Context, *amqp.Publishing, interface{}) error 20 21 // DecodeResponseFunc extracts a user-domain response object from 22 // an AMQP Delivery object. It is designed to be used in AMQP Publishers. 23 type DecodeResponseFunc func(context.Context, *amqp.Delivery) (response interface{}, err error) 24