From ce1c2f180281fad3f1ddc2347513d9d7208c9e91 Mon Sep 17 00:00:00 2001 From: CyberRoute Date: Thu, 16 Nov 2023 15:47:05 +0100 Subject: [PATCH] implementing whois query and layout, adding concurrency in a bunch of places --- cmd/bruter/concurrency.go | 19 +++++++++++++++++++ templates/whois.page.html | 20 ++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 cmd/bruter/concurrency.go create mode 100644 templates/whois.page.html diff --git a/cmd/bruter/concurrency.go b/cmd/bruter/concurrency.go new file mode 100644 index 0000000..ae30b9d --- /dev/null +++ b/cmd/bruter/concurrency.go @@ -0,0 +1,19 @@ +package main + +import ( + "sync" +) + +func RunConcurrently(tasks ...func()) { + var wg sync.WaitGroup + wg.Add(len(tasks)) + + for _, task := range tasks { + go func(t func()) { + defer wg.Done() + t() + }(task) + } + + wg.Wait() +} diff --git a/templates/whois.page.html b/templates/whois.page.html new file mode 100644 index 0000000..3347e8a --- /dev/null +++ b/templates/whois.page.html @@ -0,0 +1,20 @@ +{{template "base" .}} + +{{define "content"}} +
+
+
+
+
+
+
WHOIS Information
+
+
+

{{.WhoisInfo}}

+
+
+
+
+
+
+{{end}}