Skip to content

Commit b62e0aa

Browse files
committed
* Formatting
* Rename `Exclusive` getter to `IsExclusive`
1 parent 4335f23 commit b62e0aa

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

rabbitmq_amqp/amqp_queue.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func (a *AmqpQueueInfo) IsAutoDelete() bool {
4545
return a.isAutoDelete
4646
}
4747

48-
func (a *AmqpQueueInfo) Exclusive() bool {
48+
func (a *AmqpQueueInfo) IsExclusive() bool {
4949
return a.isExclusive
5050
}
5151

@@ -121,9 +121,7 @@ func newAmqpQueue(management *AmqpManagement, queueName string) IQueueSpecificat
121121
}
122122

123123
func (a *AmqpQueue) validate() error {
124-
125124
if a.arguments["max-length-bytes"] != nil {
126-
127125
err := validatePositive("max length", a.arguments["max-length-bytes"].(int64))
128126
if err != nil {
129127
return err
@@ -133,12 +131,12 @@ func (a *AmqpQueue) validate() error {
133131
}
134132

135133
func (a *AmqpQueue) Declare(ctx context.Context) (IQueueInfo, error) {
136-
137134
if Quorum == a.GetQueueType() ||
138135
Stream == a.GetQueueType() {
139136
// mandatory arguments for quorum queues and streams
140137
a.Exclusive(false).AutoDelete(false)
141138
}
139+
142140
if err := a.validate(); err != nil {
143141
return nil, err
144142
}

rabbitmq_amqp/amqp_queue_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var _ = Describe("AMQP Queue test ", func() {
3636
Expect(queueInfo.GetName()).To(Equal(queueName))
3737
Expect(queueInfo.IsDurable()).To(BeTrue())
3838
Expect(queueInfo.IsAutoDelete()).To(BeFalse())
39-
Expect(queueInfo.Exclusive()).To(BeFalse())
39+
Expect(queueInfo.IsExclusive()).To(BeFalse())
4040
Expect(queueInfo.Type()).To(Equal(Classic))
4141
err = queueSpec.Delete(context.TODO())
4242
Expect(err).To(BeNil())
@@ -56,7 +56,7 @@ var _ = Describe("AMQP Queue test ", func() {
5656
Expect(queueInfo.GetName()).To(Equal(queueName))
5757
Expect(queueInfo.IsDurable()).To(BeTrue())
5858
Expect(queueInfo.IsAutoDelete()).To(BeTrue())
59-
Expect(queueInfo.Exclusive()).To(BeTrue())
59+
Expect(queueInfo.IsExclusive()).To(BeTrue())
6060
Expect(queueInfo.Type()).To(Equal(Classic))
6161
Expect(queueInfo.GetLeader()).To(ContainSubstring("rabbit"))
6262
Expect(len(queueInfo.GetReplicas())).To(BeNumerically(">", 0))
@@ -82,7 +82,7 @@ var _ = Describe("AMQP Queue test ", func() {
8282
Expect(queueInfo.GetName()).To(Equal(queueName))
8383
Expect(queueInfo.IsDurable()).To(BeTrue())
8484
Expect(queueInfo.IsAutoDelete()).To(BeFalse())
85-
Expect(queueInfo.Exclusive()).To(BeFalse())
85+
Expect(queueInfo.IsExclusive()).To(BeFalse())
8686
Expect(queueInfo.Type()).To(Equal(Quorum))
8787
err = queueSpec.Delete(context.TODO())
8888
Expect(err).To(BeNil())
@@ -101,7 +101,7 @@ var _ = Describe("AMQP Queue test ", func() {
101101
Expect(queueInfo.GetName()).To(Equal(queueName))
102102
Expect(queueInfo.IsDurable()).To(BeTrue())
103103
Expect(queueInfo.IsAutoDelete()).To(BeFalse())
104-
Expect(queueInfo.Exclusive()).To(BeFalse())
104+
Expect(queueInfo.IsExclusive()).To(BeFalse())
105105
Expect(queueInfo.Type()).To(Equal(Stream))
106106
err = queueSpec.Delete(context.TODO())
107107
Expect(err).To(BeNil())

rabbitmq_amqp/entities.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ type IQueueInfo interface {
4646
GetName() string
4747
IsDurable() bool
4848
IsAutoDelete() bool
49-
Exclusive() bool
49+
IsExclusive() bool
5050
Type() TQueueType
5151
GetLeader() string
5252
GetReplicas() []string

0 commit comments

Comments
 (0)