9b3c681e2b7fc2287e5eb90fb3436debc4e3d8a1

Author
Ayman Bagabas <ayman.bagabas@gmail.com>
Committer
Ayman Bagabas <ayman.bagabas@gmail.com>
Date

Message

Use wish options

Diff

 1diff --git a/main.go b/main.go
 2index db24d054c0a7f3c5117f0193a7dbcde912522b68..71288764ed2e2fd5da0ff9e8b50e20499848de3f 100644
 3--- a/main.go
 4+++ b/main.go
 5@@ -30,11 +30,13 @@ func main() {
 6 		log.Fatalln(err)
 7 	}
 8 	s, err := wish.NewServer(
 9-		fmt.Sprintf("%s:%d", cfg.Host, cfg.Port),
10-		cfg.KeyPath,
11-		bm.Middleware(tui.SessionHandler(cfg.RepoPath, time.Second*5)),
12-		gm.Middleware(cfg.RepoPath, cfg.RepoAuth, cfg.RepoAuthFile),
13-		lm.Middleware(),
14+		wish.WithAddress(fmt.Sprintf("%s:%d", cfg.Host, cfg.Port)),
15+		wish.WithHostKeyPath(cfg.KeyPath),
16+		wish.WithMiddlewares(
17+			bm.Middleware(tui.SessionHandler(cfg.RepoPath, time.Second*5)),
18+			gm.Middleware(cfg.RepoPath, cfg.RepoAuth, cfg.RepoAuthFile),
19+			lm.Middleware(),
20+		),
21 	)
22 	if err != nil {
23 		log.Fatalln(err)