From 38485ede265d22e11a316b4d66de1bf0feb945be Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sat, 24 Jul 2021 09:46:59 +0200 Subject: Update --- cmd/gopherproxy/main.go | 25 +++++++++++++++++++++++++ cmd/port/main.go | 25 ------------------------- 2 files changed, 25 insertions(+), 25 deletions(-) create mode 100644 cmd/gopherproxy/main.go delete mode 100644 cmd/port/main.go (limited to 'cmd') diff --git a/cmd/gopherproxy/main.go b/cmd/gopherproxy/main.go new file mode 100644 index 0000000..1b69671 --- /dev/null +++ b/cmd/gopherproxy/main.go @@ -0,0 +1,25 @@ +package main + +import ( + "flag" + "log" + + gopherproxy "git.vulpes.one/gopherproxy/internal/gopherproxy" +) + +var ( + // TODO: Allow config file and environment vars + // (opt -> env -> config -> default) + bind = flag.String("bind", "0.0.0.0:8000", "[int]:port to bind to") + startpagefile = flag.String("startpage-file", "startpage.txt", "Default page to display if no URL is specified") + robotsfile = flag.String("robots-file", "robots.txt", "robots.txt file") + robotsdebug = flag.Bool("robots-debug", false, "print output about ignored robots.txt") + vipsconcurrency = flag.Int("vips-concurrency", 1, "Concurrency level of libvips") +) + +func main() { + flag.Parse() + + // Use a gopherproxy struct + log.Fatal(gopherproxy.ListenAndServe(*bind, *startpagefile, *robotsfile, *robotsdebug, *vipsconcurrency)) +} diff --git a/cmd/port/main.go b/cmd/port/main.go deleted file mode 100644 index 6cdccc6..0000000 --- a/cmd/port/main.go +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "flag" - "log" - - port "git.vulpes.one/Feuerfuchs/port/internal/port" -) - -var ( - // TODO: Allow config file and environment vars - // (opt -> env -> config -> default) - bind = flag.String("bind", "0.0.0.0:8000", "[int]:port to bind to") - startpagefile = flag.String("startpage-file", "startpage.txt", "Default page to display if no URL is specified") - robotsfile = flag.String("robots-file", "robots.txt", "robots.txt file") - robotsdebug = flag.Bool("robots-debug", false, "print output about ignored robots.txt") - vipsconcurrency = flag.Int("vips-concurrency", 1, "Concurrency level of libvips") -) - -func main() { - flag.Parse() - - // Use a config struct - log.Fatal(port.ListenAndServe(*bind, *startpagefile, *robotsfile, *robotsdebug, *vipsconcurrency)) -} -- cgit v1.2.3-54-g00ecf