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:
parent
8c7640aa09
commit
529f65674e
18 changed files with 60 additions and 61 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue