@@ -12,7 +12,10 @@ import (
1212// Option is the function signature required to be considered an amqp.Option.
1313type Option func (* Protocol ) error
1414
15- // WithConnOpt sets a connection option for amqp
15+ type SendOption func (sender * sender )
16+ type ReceiveOption func (receiver * receiver )
17+
18+ // WithConnOpts sets a connection option for amqp
1619func WithConnOpts (opt * amqp.ConnOptions ) Option {
1720 return func (t * Protocol ) error {
1821 t .connOpts = opt
@@ -26,43 +29,59 @@ func WithConnSASLPlain(opt *amqp.ConnOptions, username, password string) Option
2629 return WithConnOpts (opt )
2730}
2831
29- // WithSessionOpt sets a session option for amqp
32+ // WithSessionOpts sets a session option for amqp
3033func WithSessionOpts (opt * amqp.SessionOptions ) Option {
3134 return func (t * Protocol ) error {
3235 t .sessionOpts = opt
3336 return nil
3437 }
3538}
3639
37- // WithSenderLinkOption sets a link option for amqp
40+ // WithSenderOpts sets a link option for amqp
3841func WithSenderOpts (opt * amqp.SenderOptions ) Option {
3942 return func (t * Protocol ) error {
4043 t .senderOpts = opt
4144 return nil
4245 }
4346}
4447
45- // WithReceiverLinkOption sets a link option for amqp
48+ // WithReceiverOpts sets a link option for amqp
4649func WithReceiverOpts (opt * amqp.ReceiverOptions ) Option {
4750 return func (t * Protocol ) error {
4851 t .receiverOpts = opt
4952 return nil
5053 }
5154}
5255
53- func WithReceiveOpts (opt amqp.ReceiveOptions ) Option {
56+ // WithReceiveOpts sets a receive option for amqp
57+ func WithReceiveOpts (opt * amqp.ReceiveOptions ) Option {
5458 return func (t * Protocol ) error {
5559 t .receiveOpts = opt
5660 return nil
5761 }
5862}
5963
64+ // WithSendOpts sets a send option for amqp
6065func WithSendOpts (opt * amqp.SendOptions ) Option {
6166 return func (t * Protocol ) error {
6267 t .sendOpts = opt
6368 return nil
6469 }
6570}
6671
72+ // WithSendOptions sets send options for amqp
73+ func WithSendOptions (opts * amqp.SendOptions ) SendOption {
74+ return func (t * sender ) {
75+ t .options = opts
76+ }
77+ }
78+
79+ // WithReceiveOptions sets receive options for amqp
80+ func WithReceiveOptions (opts * amqp.ReceiveOptions ) ReceiveOption {
81+ return func (t * receiver ) {
82+ t .options = opts
83+ }
84+ }
85+
6786// SenderOptionFunc is the type of amqp.Sender options
6887type SenderOptionFunc func (sender * sender )
0 commit comments