summaryrefslogtreecommitdiff
path: root/rpc/config.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-10 16:44:41 +0300
committerWolfy-J <[email protected]>2018-06-10 16:44:41 +0300
commit4c292ee46f5505b00b16186e8f30e9bc1be25895 (patch)
tree818dffc7ce5e890875b147b97e298d4c7c48cbd9 /rpc/config.go
parenta62237fa5afc310453e709837e363f0bb4d7ecf3 (diff)
fs config
Diffstat (limited to 'rpc/config.go')
-rw-r--r--rpc/config.go35
1 files changed, 0 insertions, 35 deletions
diff --git a/rpc/config.go b/rpc/config.go
deleted file mode 100644
index 8a34752a..00000000
--- a/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])
-}