1.2 KiB
1.2 KiB
Problem
The build is failing because the HTTP server is trying to access DNSSEC-related fields (DNSSECQueries, DNSSECSuccess, DNSSECFailed, DNSSECEnabled) from the dns.Stats struct, but these fields don't exist in the struct definition.
Solution
Add the missing DNSSEC-related fields to the Stats struct in dns/server.go and ensure they're properly initialized and updated.
Implementation Steps
-
Add DNSSEC fields to Stats struct in
/root/dns/dns/server.go:- Add
DNSSECQueries int64field - Add
DNSSECSuccess int64field - Add
DNSSECFailed int64field - Add
DNSSECEnabled boolfield
- Add
-
Initialize DNSSEC fields in NewServer function:
- Set
DNSSECEnabledbased on config.EnableDNSSEC - Initialize other DNSSEC fields to 0
- Set
-
Update DNSSEC stats in query handling:
- Increment
DNSSECQuerieswhen a DNSSEC query is processed - Update
DNSSECSuccessandDNSSECFailedbased on DNSSEC validation results
- Increment
-
Test the fix by running
go buildto ensure all errors are resolved
Expected Outcome
The build will succeed and the HTTP server will be able to access the DNSSEC-related stats fields.