summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-07-07 10:46:24 +0530
committersinanmohd <sinan@sinanmohd.com>2024-07-07 10:46:24 +0530
commitb80d81a5cacc146b7bf7c92a716858d72cefb2be (patch)
tree8cfd8f259630bda02846db822b81d7c65550ed14 /cmd
parent4e2671608059ca5d99586eab3ff61ef1da9b0d23 (diff)
dns: init
Diffstat (limited to 'cmd')
-rw-r--r--cmd/redq/main.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/cmd/redq/main.go b/cmd/redq/main.go
index f9d9542..6597749 100644
--- a/cmd/redq/main.go
+++ b/cmd/redq/main.go
@@ -12,12 +12,10 @@ import (
"sinanmohd.com/redq/api"
"sinanmohd.com/redq/db"
"sinanmohd.com/redq/usage"
+ "sinanmohd.com/redq/dns"
)
func main() {
- var u *usage.Usage
- var a *api.Api
-
iface, err := net.InterfaceByName("wlan0")
if err != nil {
log.Fatalf("lookup network: %s", err)
@@ -31,11 +29,15 @@ func main() {
defer conn.Close(ctx)
queries := db.New(conn)
- a, err = api.New()
+ d, err := dns.New()
if err != nil {
os.Exit(0)
}
- u, err = usage.New(iface)
+ a, err := api.New()
+ if err != nil {
+ os.Exit(0)
+ }
+ u, err := usage.New(iface)
if err != nil {
os.Exit(0)
}
@@ -50,5 +52,7 @@ func main() {
}()
go u.Run(iface, queries, ctx)
+ go d.Run()
+
a.Run(u, queries, ctx)
}