aboutsummaryrefslogtreecommitdiff
path: root/rpc.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-04-01 17:45:07 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-04-01 17:45:07 +0200
commitc7736d8e94b98c0a4cb9069195cf0e0cfe147283 (patch)
tree71d3405d7702e2cb8dac4c26137ed94b4ff198a0 /rpc.go
parente3b305e171e6aae5b12db75674003604d0292c9e (diff)
Readd rpc.List
Diffstat (limited to 'rpc.go')
-rw-r--r--rpc.go29
1 files changed, 14 insertions, 15 deletions
diff --git a/rpc.go b/rpc.go
index 71ef552..db1c296 100644
--- a/rpc.go
+++ b/rpc.go
@@ -3,6 +3,7 @@ package goxy
import (
"crypto/tls"
"errors"
+ "fmt"
"net/rpc"
"net/url"
)
@@ -14,6 +15,14 @@ var (
const RPCPort = ":8000"
+// Entry holds routing settings
+type Entry struct {
+ Host string // URL
+ Upstream string // URL
+ Cert []byte // PEM
+ Key []byte // PEM
+}
+
type GoXY struct {
server *Server
}
@@ -82,22 +91,12 @@ func (s *GoXY) Get(host string, e *Entry) error {
*e = s.server.Route[host]
return nil
}
+*/
// List routes
-func (s GoXY) List(_ struct{}, r *Route) error {
- *r = s.server.Route
+func (s GoXY) List(_ struct{}, ret *[]string) error {
+ for _, v := range s.server.Route {
+ *ret = append(*ret, fmt.Sprint(v))
+ }
return nil
}
-*/
-
-// Entry holds routing settings
-type Entry struct {
- Host string // HostName
- Upstream string // URL
- Cert []byte // PEM
- Key []byte // PEM
-}
-
-func (e Entry) String() string {
- return e.Host + " → " + e.Upstream
-}