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
|
|
@ -51,15 +51,14 @@ const (
|
|||
)
|
||||
|
||||
type BotConfig struct {
|
||||
Name string `json:"name"`
|
||||
UserAgentRegex *string `json:"user_agent_regex"`
|
||||
PathRegex *string `json:"path_regex"`
|
||||
HeadersRegex map[string]string `json:"headers_regex"`
|
||||
RemoteAddr []string `json:"remote_addresses"`
|
||||
Expression *ExpressionOrList `json:"expression"`
|
||||
|
||||
Action Rule `json:"action"`
|
||||
Challenge *ChallengeRules `json:"challenge,omitempty"`
|
||||
Challenge *ChallengeRules `json:"challenge,omitempty"`
|
||||
Name string `json:"name"`
|
||||
Action Rule `json:"action"`
|
||||
RemoteAddr []string `json:"remote_addresses"`
|
||||
}
|
||||
|
||||
func (b BotConfig) Zero() bool {
|
||||
|
|
@ -171,9 +170,9 @@ func (b BotConfig) Valid() error {
|
|||
}
|
||||
|
||||
type ChallengeRules struct {
|
||||
Algorithm Algorithm `json:"algorithm"`
|
||||
Difficulty int `json:"difficulty"`
|
||||
ReportAs int `json:"report_as"`
|
||||
Algorithm Algorithm `json:"algorithm"`
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue