update the interface

This commit is contained in:
idk
2019-08-31 02:50:11 -04:00
parent c427d576cb
commit 6b873f4fc2
34 changed files with 68 additions and 941 deletions

View File

@ -1,11 +1,5 @@
package i2ptunconf
import (
"fmt"
"strconv"
)
import "github.com/eyedeekay/sam-forwarder/interface"
// GetHost takes an argument and a default. If the argument differs from the
// default, the argument is always returned. If the argument and default are
@ -58,26 +52,3 @@ func (c *Conf) SetControlPort(label ...string) {
c.ControlPort = ""
}
}
//SetControlHost sets the host of the service to forward
func SetControlHost(s string) func(samtunnel.SAMTunnel) error {
return func(c samtunnel.SAMTunnel) error {
c.(*Conf).ControlHost = s
return nil
}
}
//SetControlPort sets the port of the service to forward
func SetControlPort(s string) func(samtunnel.SAMTunnel) error {
return func(c samtunnel.SAMTunnel) error {
port, err := strconv.Atoi(s)
if err != nil {
return fmt.Errorf("Invalid TCP Server Target Port %s; non-number ", s)
}
if port < 65536 && port > -1 {
c.(*Conf).ControlPort = s
return nil
}
return fmt.Errorf("Invalid port")
}
}