From f147fb47bb9c683d752dc94af322dd75ebcd237f Mon Sep 17 00:00:00 2001 From: lordwelch Date: Tue, 16 Jun 2020 05:32:53 -0700 Subject: [PATCH] Add JSON tags --- Makefile | 2 +- internal/dns/dns.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 5b18ecc..0ea90f7 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ PKGS := github.com/rtr7/router7/cmd/... \ build: mkdir -p result GOOS=linux go build -o ./result github.com/rtr7/router7/cmd/... - GOOS=linux go build -o ./result/rtr7-init -ldflags "-X main.buildTimestamp=$(shell date '+%Y-%m-%dT%H:%M:%S%z') -X github.com/gokrazy/gokrazy.httpPassword=temp" init/init.go + GOOS=linux go build -o ./result/rtr7-init -ldflags "-X main.buildTimestamp=$(shell date '+%Y-%m-%dT%H:%M:%S%z') -X github.com/gokrazy/gokrazy.httpPassword=hello" init/init.go clean: rm -rf result diff --git a/internal/dns/dns.go b/internal/dns/dns.go index 6f2997f..0f1a69a 100644 --- a/internal/dns/dns.go +++ b/internal/dns/dns.go @@ -44,9 +44,9 @@ var log = teelogger.NewConsole() type lcHostname string type IP struct { - IPv6 net.IP - IPv4 net.IP - Host lcHostname // lease that the IPs are updated from. If no lease exists for this host it is never updated. + IPv6 net.IP `json:"ipv6"` + IPv4 net.IP `json:"ipv4"` + Host lcHostname `json:"host"` // lease that the IPs are updated from. If no lease exists for this host it is never updated. } type Server struct {