Exemplo n.º 1
0
func (ex1 *Exchange) EquivalentExchanges(ex2 *Exchange) bool {
	// NOTE: auto-delete is ignored for existing exchanges, so we
	// do not check it here.
	if ex1.Name != ex2.Name {
		return false
	}
	if ex1.ExType != ex2.ExType {
		return false
	}
	if ex1.Durable != ex2.Durable {
		return false
	}
	if ex1.Internal != ex2.Internal {
		return false
	}
	if !amqp.EquivalentTables(ex1.Arguments, ex2.Arguments) {
		return false
	}
	return true
}
Exemplo n.º 2
0
func (q1 *Queue) EquivalentQueues(q2 *Queue) bool {
	if q1 == nil {
		return q2 == nil
	}
	if q2 == nil {
		return false
	}

	// Note: autodelete is not included since the spec says to ignore
	// the field if the queue is already created
	if q1.Name != q2.Name {
		return false
	}
	if q1.Durable != q2.Durable {
		return false
	}
	if q1.exclusive != q2.exclusive {
		return false
	}
	if !amqp.EquivalentTables(q1.Arguments, q2.Arguments) {
		return false
	}
	return true
}