service: add service module

This commit is contained in:
nadoo committed 2020-09-27 19:50:21 +08:00
1 parent 9ca06ee32f
commit 4e966cc319
8 files changed
+69 -28

No files matched your search

+1 -4
View File
@@ -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
}
+1 -4
View File
@@ -5,8 +5,6 @@ import (
"net"
"net/url"
"strings"
"github.com/nadoo/glider/common/log"
)
// Server interface
@@ -27,7 +25,7 @@ var (
// RegisterServer is used to register a proxy server
func RegisterServer(name string, c ServerCreator) {
serverCreators[name] = c
serverCreators[strings.ToLower(name)] = c
}
// ServerFromURL calls the registered creator to create proxy servers
@@ -43,7 +41,6 @@ func ServerFromURL(s string, p Proxy) (Server, error) {
u, err := url.Parse(s)
if err != nil {
log.F("parse err: %s", err)
return nil, err
}