summaryrefslogtreecommitdiff
path: root/pkg/server/hook/b85.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/server/hook/b85.go')
-rw-r--r--pkg/server/hook/b85.go19
1 files changed, 5 insertions, 14 deletions
diff --git a/pkg/server/hook/b85.go b/pkg/server/hook/b85.go
index bf36b56..d90a1c4 100644
--- a/pkg/server/hook/b85.go
+++ b/pkg/server/hook/b85.go
@@ -3,15 +3,14 @@ package hook
import (
"encoding/ascii85"
"errors"
+
"tunnel/pkg/netstring"
- "tunnel/pkg/server/env"
- "tunnel/pkg/server/opts"
"tunnel/pkg/server/queue"
)
-type b85Hook struct{}
+type b85Pipe struct{}
-func (b85Hook) Send(rq, wq queue.Q) error {
+func (b85Pipe) Send(rq, wq queue.Q) error {
e := netstring.NewEncoder(wq.Writer())
for b := range rq {
@@ -23,7 +22,7 @@ func (b85Hook) Send(rq, wq queue.Q) error {
return nil
}
-func (b85Hook) Recv(rq, wq queue.Q) error {
+func (b85Pipe) Recv(rq, wq queue.Q) error {
d := netstring.NewDecoder(rq.Reader())
for {
@@ -44,14 +43,6 @@ func (b85Hook) Recv(rq, wq queue.Q) error {
}
}
-func (h b85Hook) Open(env.Env) (interface{}, error) {
- return h, nil
-}
-
-func newB85Hook(opts.Opts) (hook, error) {
- return b85Hook{}, nil
-}
-
func init() {
- register("b85", newB85Hook)
+ registerPipe("b85", b85Pipe{})
}