mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
service: add service module
This commit is contained in:
1 parent
9ca06ee32f
commit
4e966cc319
8 files changed
+69
-28
No files matched your search
+1
-4
@@ -5,8 +5,6 @@ import (
|
||||
"net"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"github.com/nadoo/glider/common/log"
|
||||
)
|
||||
|
||||
// Dialer is used to create connection.
|
||||
@@ -42,7 +40,7 @@ var (
|
||||
|
||||
// RegisterDialer is used to register a dialer.
|
||||
func RegisterDialer(name string, c DialerCreator) {
|
||||
dialerCreators[name] = c
|
||||
dialerCreators[strings.ToLower(name)] = c
|
||||
}
|
||||
|
||||
// DialerFromURL calls the registered creator to create dialers.
|
||||
@@ -54,7 +52,6 @@ func DialerFromURL(s string, dialer Dialer) (Dialer, error) {
|
||||
|
||||
u, err := url.Parse(s)
|
||||
if err != nil {
|
||||
log.F("parse err: %s", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user