diff options
author | Wolfy-J <[email protected]> | 2018-06-10 17:06:06 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-10 17:06:06 +0300 |
commit | 232aa8f3c20a060e556ab431467f4f7b3f83bfbf (patch) | |
tree | a9dacbc142020cabae6a0708733aadb7e789aea5 /service/rpc/config.go | |
parent | 3fe85e9d92f5f98337e8f7fd9a14e6b66b9694bd (diff) |
http service
Diffstat (limited to 'service/rpc/config.go')
-rw-r--r-- | service/rpc/config.go | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/service/rpc/config.go b/service/rpc/config.go deleted file mode 100644 index 8a34752a..00000000 --- a/service/rpc/config.go +++ /dev/null @@ -1,35 +0,0 @@ -package rpc - -import ( - "errors" - "net" - "strings" -) - -type config struct { - // Indicates if RPC connection is enabled. - Enable bool - - // Listen string - Listen string -} - -// listener creates new rpc socket listener. -func (cfg *config) listener() (net.Listener, error) { - dsn := strings.Split(cfg.Listen, "://") - if len(dsn) != 2 { - return nil, errors.New("invalid socket DSN (tcp://:6001, unix://rpc.sock)") - } - - return net.Listen(dsn[0], dsn[1]) -} - -// dialer creates rpc socket dialer. -func (cfg *config) dialer() (net.Conn, error) { - dsn := strings.Split(cfg.Listen, "://") - if len(dsn) != 2 { - return nil, errors.New("invalid socket DSN (tcp://:6001, unix://rpc.sock)") - } - - return net.Dial(dsn[0], dsn[1]) -} |