mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-17 05:44:57 +00:00
style: improve alignment of struct fields in AnubisRule and OGTagCache
This commit is contained in:
@@ -36,8 +36,7 @@ type RobotsRule struct {
|
|||||||
IsBlacklist bool // true if this is a specifically denied user agent
|
IsBlacklist bool // true if this is a specifically denied user agent
|
||||||
}
|
}
|
||||||
|
|
||||||
//betteralign:ignore, we want name to be the first field
|
type AnubisRule struct { // betteralign:ignore, we want name to be the first field
|
||||||
type AnubisRule struct {
|
|
||||||
Name string `yaml:"name" json:"name"`
|
Name string `yaml:"name" json:"name"`
|
||||||
Action string `yaml:"action" json:"action"`
|
Action string `yaml:"action" json:"action"`
|
||||||
Expression map[string]interface{} `yaml:"expression,omitempty" json:"expression,omitempty"`
|
Expression map[string]interface{} `yaml:"expression,omitempty" json:"expression,omitempty"`
|
||||||
|
|||||||
@@ -21,17 +21,17 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type OGTagCache struct {
|
type OGTagCache struct {
|
||||||
cache *decaymap.Impl[string, map[string]string]
|
cache *decaymap.Impl[string, map[string]string]
|
||||||
targetURL *url.URL
|
targetURL *url.URL
|
||||||
client *http.Client
|
client *http.Client
|
||||||
|
|
||||||
|
// Pre-built strings for optimization
|
||||||
|
unixPrefix string // "http://unix"
|
||||||
approvedTags []string
|
approvedTags []string
|
||||||
approvedPrefixes []string
|
approvedPrefixes []string
|
||||||
ogTimeToLive time.Duration
|
ogTimeToLive time.Duration
|
||||||
ogCacheConsiderHost bool
|
ogCacheConsiderHost bool
|
||||||
ogPassthrough bool
|
ogPassthrough bool
|
||||||
|
|
||||||
// Pre-built strings for optimization
|
|
||||||
unixPrefix string // "http://unix"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewOGTagCache(target string, ogPassthrough bool, ogTimeToLive time.Duration, ogTagsConsiderHost bool) *OGTagCache {
|
func NewOGTagCache(target string, ogPassthrough bool, ogTimeToLive time.Duration, ogTagsConsiderHost bool) *OGTagCache {
|
||||||
|
|||||||
Reference in New Issue
Block a user