From f2f1d874e1b4f997c111de87121eec98eef66381 Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 4 Mar 2018 23:52:14 +0100 Subject: Use viper (github.com/spf13/viper) for configuration --- bridge/sshchat/sshchat.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bridge/sshchat') diff --git a/bridge/sshchat/sshchat.go b/bridge/sshchat/sshchat.go index c11d3daa..3204d734 100644 --- a/bridge/sshchat/sshchat.go +++ b/bridge/sshchat/sshchat.go @@ -14,18 +14,18 @@ import ( type Bsshchat struct { r *bufio.Scanner w io.WriteCloser - *config.BridgeConfig + *bridge.Config } -func New(cfg *config.BridgeConfig) bridge.Bridger { - return &Bsshchat{BridgeConfig: cfg} +func New(cfg *bridge.Config) bridge.Bridger { + return &Bsshchat{Config: cfg} } func (b *Bsshchat) Connect() error { var err error - b.Log.Infof("Connecting %s", b.Config.Server) + b.Log.Infof("Connecting %s", b.GetString("Server")) go func() { - err = sshd.ConnectShell(b.Config.Server, b.Config.Nick, func(r io.Reader, w io.WriteCloser) error { + err = sshd.ConnectShell(b.GetString("Server"), b.GetString("Nick"), func(r io.Reader, w io.WriteCloser) error { b.r = bufio.NewScanner(r) b.w = w b.r.Scan() -- cgit v1.2.3