From 1f7b27acb50b63c8cfb73e7907a008e5df89e7a2 Mon Sep 17 00:00:00 2001 From: Artyom Blagov Date: Thu, 25 Oct 2018 12:04:15 +0300 Subject: [PATCH] add support func NewConnector --- conn/dialers.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/conn/dialers.go b/conn/dialers.go index 7949fe6..1b0400c 100644 --- a/conn/dialers.go +++ b/conn/dialers.go @@ -95,3 +95,9 @@ func ConfigConnector(url string, config amqp.Config, opts ...ConnectionOption) C return DialConfig(url, config, opts...) } } + +func NewConnector(url string, opts ...ConnectionOption) Connector { + return func() (*Connection, error) { + return Connect(url, opts...), nil + } +}