From 9b3c681e2b7fc2287e5eb90fb3436debc4e3d8a1 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Fri, 3 Sep 2021 11:27:49 -0400 Subject: [PATCH] Use wish options --- main.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index db24d054c..71288764e 100644 --- a/main.go +++ b/main.go @@ -30,11 +30,13 @@ func main() { log.Fatalln(err) } s, err := wish.NewServer( - fmt.Sprintf("%s:%d", cfg.Host, cfg.Port), - cfg.KeyPath, - bm.Middleware(tui.SessionHandler(cfg.RepoPath, time.Second*5)), - gm.Middleware(cfg.RepoPath, cfg.RepoAuth, cfg.RepoAuthFile), - lm.Middleware(), + wish.WithAddress(fmt.Sprintf("%s:%d", cfg.Host, cfg.Port)), + wish.WithHostKeyPath(cfg.KeyPath), + wish.WithMiddlewares( + bm.Middleware(tui.SessionHandler(cfg.RepoPath, time.Second*5)), + gm.Middleware(cfg.RepoPath, cfg.RepoAuth, cfg.RepoAuthFile), + lm.Middleware(), + ), ) if err != nil { log.Fatalln(err)