From 9f7ecdb75ae01de67d8fdaa8c5bd01052631d285 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 29 Jun 2025 19:42:42 +0200 Subject: [PATCH] perf(model): save 16 bytes in the FeedCreationRequest struct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit before: ``` // feed.go:154 | Size: 240 (Optimal: 224) type FeedCreationRequest struct { FeedURL string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ CategoryID int64 ■ ■ ■ ■ ■ ■ ■ ■ UserAgent string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Cookie string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Username string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Password string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Crawler bool ■ Disabled bool ■ NoMediaPlayer bool ■ IgnoreHTTPCache bool ■ AllowSelfSignedCertificates bool ■ FetchViaProxy bool ■ □ □ UrlRewriteRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ DisableHTTP2 bool ■ □ □ □ □ □ □ □ ScraperRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ RewriteRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ BlocklistRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ KeeplistRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ BlockFilterEntryRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ KeepFilterEntryRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ HideGlobally bool ■ □ □ □ □ □ □ □ ProxyURL string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ } ``` after: ``` // feed.go:154 | Size: 224 type FeedCreationRequest struct { FeedURL string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ CategoryID int64 ■ ■ ■ ■ ■ ■ ■ ■ UserAgent string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Cookie string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Username string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Password string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Crawler bool ■ Disabled bool ■ NoMediaPlayer bool ■ IgnoreHTTPCache bool ■ AllowSelfSignedCertificates bool ■ FetchViaProxy bool ■ HideGlobally bool ■ DisableHTTP2 bool ■ ScraperRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ RewriteRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ BlocklistRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ KeeplistRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ BlockFilterEntryRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ KeepFilterEntryRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ UrlRewriteRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ProxyURL string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ } ``` --- internal/model/feed.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/model/feed.go b/internal/model/feed.go index 02908b49..c9713a22 100644 --- a/internal/model/feed.go +++ b/internal/model/feed.go @@ -164,15 +164,15 @@ type FeedCreationRequest struct { IgnoreHTTPCache bool `json:"ignore_http_cache"` AllowSelfSignedCertificates bool `json:"allow_self_signed_certificates"` FetchViaProxy bool `json:"fetch_via_proxy"` + HideGlobally bool `json:"hide_globally"` + DisableHTTP2 bool `json:"disable_http2"` ScraperRules string `json:"scraper_rules"` RewriteRules string `json:"rewrite_rules"` BlocklistRules string `json:"blocklist_rules"` KeeplistRules string `json:"keeplist_rules"` BlockFilterEntryRules string `json:"block_filter_entry_rules"` KeepFilterEntryRules string `json:"keep_filter_entry_rules"` - HideGlobally bool `json:"hide_globally"` UrlRewriteRules string `json:"urlrewrite_rules"` - DisableHTTP2 bool `json:"disable_http2"` ProxyURL string `json:"proxy_url"` }