style: apply structpack & goimport (#469)

* refactor: reorder import statements in fetch.go and fetch_test.go

Signed-off-by: Jason Cameron <git@jasoncameron.dev>

* fix: optimize struct field alignment to reduce memory usage

Signed-off-by: Jason Cameron <git@jasoncameron.dev>

---------

Signed-off-by: Jason Cameron <git@jasoncameron.dev>
This commit is contained in:
Jason Cameron 2025-05-09 12:54:15 -04:00 committed by GitHub
parent 8c7640aa09
commit 529f65674e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 60 additions and 61 deletions

View file

@ -58,14 +58,14 @@ var (
)
type Server struct {
mux *http.ServeMux
next http.Handler
priv ed25519.PrivateKey
pub ed25519.PublicKey
mux *http.ServeMux
policy *policy.ParsedConfig
opts Options
DNSBLCache *decaymap.Impl[string, dnsbl.DroneBLResponse]
OGTags *ogtags.OGTagCache
priv ed25519.PrivateKey
pub ed25519.PublicKey
opts Options
}
func (s *Server) challengeFor(r *http.Request, difficulty int) string {
@ -232,8 +232,8 @@ func (s *Server) MakeChallenge(w http.ResponseWriter, r *http.Request) {
challenge := s.challengeFor(r, rule.Challenge.Difficulty)
err = encoder.Encode(struct {
Challenge string `json:"challenge"`
Rules *config.ChallengeRules `json:"rules"`
Challenge string `json:"challenge"`
}{
Challenge: challenge,
Rules: rule.Challenge,