diff options
author | 2023-01-10 15:19:05 +0100 | |
---|---|---|
committer | 2023-01-10 14:19:05 +0000 | |
commit | d6487933c758be647bff7a568d6a33e6155e6599 (patch) | |
tree | fbc2d466dc2d0833a7ceec1200643e78dae4f916 /internal/config/helpers.gen.go | |
parent | [chore] Bump json5 from 1.0.1 to 1.0.2 in /web/source (#1308) (diff) | |
download | gotosocial-d6487933c758be647bff7a568d6a33e6155e6599.tar.xz |
[feature] Implement Report database model and utility functions (#1310)
* implement report database model
* implement report cache + config changes
* implement report database functions
* report uri / regex functions
* update envparsing test
* remove unnecessary uri index
* remove unused function + cache lookup
* process error when storing report
Diffstat (limited to 'internal/config/helpers.gen.go')
-rw-r--r-- | internal/config/helpers.gen.go | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/internal/config/helpers.gen.go b/internal/config/helpers.gen.go index a1f920ac7..f340360b2 100644 --- a/internal/config/helpers.gen.go +++ b/internal/config/helpers.gen.go @@ -2378,6 +2378,81 @@ func GetCacheGTSNotificationSweepFreq() time.Duration { // SetCacheGTSNotificationSweepFreq safely sets the value for global configuration 'Cache.GTS.NotificationSweepFreq' field func SetCacheGTSNotificationSweepFreq(v time.Duration) { global.SetCacheGTSNotificationSweepFreq(v) } +// GetCacheGTSReportMaxSize safely fetches the Configuration value for state's 'Cache.GTS.ReportMaxSize' field +func (st *ConfigState) GetCacheGTSReportMaxSize() (v int) { + st.mutex.Lock() + v = st.config.Cache.GTS.ReportMaxSize + st.mutex.Unlock() + return +} + +// SetCacheGTSReportMaxSize safely sets the Configuration value for state's 'Cache.GTS.ReportMaxSize' field +func (st *ConfigState) SetCacheGTSReportMaxSize(v int) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.Cache.GTS.ReportMaxSize = v + st.reloadToViper() +} + +// CacheGTSReportMaxSizeFlag returns the flag name for the 'Cache.GTS.ReportMaxSize' field +func CacheGTSReportMaxSizeFlag() string { return "cache-gts-report-max-size" } + +// GetCacheGTSReportMaxSize safely fetches the value for global configuration 'Cache.GTS.ReportMaxSize' field +func GetCacheGTSReportMaxSize() int { return global.GetCacheGTSReportMaxSize() } + +// SetCacheGTSReportMaxSize safely sets the value for global configuration 'Cache.GTS.ReportMaxSize' field +func SetCacheGTSReportMaxSize(v int) { global.SetCacheGTSReportMaxSize(v) } + +// GetCacheGTSReportTTL safely fetches the Configuration value for state's 'Cache.GTS.ReportTTL' field +func (st *ConfigState) GetCacheGTSReportTTL() (v time.Duration) { + st.mutex.Lock() + v = st.config.Cache.GTS.ReportTTL + st.mutex.Unlock() + return +} + +// SetCacheGTSReportTTL safely sets the Configuration value for state's 'Cache.GTS.ReportTTL' field +func (st *ConfigState) SetCacheGTSReportTTL(v time.Duration) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.Cache.GTS.ReportTTL = v + st.reloadToViper() +} + +// CacheGTSReportTTLFlag returns the flag name for the 'Cache.GTS.ReportTTL' field +func CacheGTSReportTTLFlag() string { return "cache-gts-report-ttl" } + +// GetCacheGTSReportTTL safely fetches the value for global configuration 'Cache.GTS.ReportTTL' field +func GetCacheGTSReportTTL() time.Duration { return global.GetCacheGTSReportTTL() } + +// SetCacheGTSReportTTL safely sets the value for global configuration 'Cache.GTS.ReportTTL' field +func SetCacheGTSReportTTL(v time.Duration) { global.SetCacheGTSReportTTL(v) } + +// GetCacheGTSReportSweepFreq safely fetches the Configuration value for state's 'Cache.GTS.ReportSweepFreq' field +func (st *ConfigState) GetCacheGTSReportSweepFreq() (v time.Duration) { + st.mutex.Lock() + v = st.config.Cache.GTS.ReportSweepFreq + st.mutex.Unlock() + return +} + +// SetCacheGTSReportSweepFreq safely sets the Configuration value for state's 'Cache.GTS.ReportSweepFreq' field +func (st *ConfigState) SetCacheGTSReportSweepFreq(v time.Duration) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.Cache.GTS.ReportSweepFreq = v + st.reloadToViper() +} + +// CacheGTSReportSweepFreqFlag returns the flag name for the 'Cache.GTS.ReportSweepFreq' field +func CacheGTSReportSweepFreqFlag() string { return "cache-gts-report-sweep-freq" } + +// GetCacheGTSReportSweepFreq safely fetches the value for global configuration 'Cache.GTS.ReportSweepFreq' field +func GetCacheGTSReportSweepFreq() time.Duration { return global.GetCacheGTSReportSweepFreq() } + +// SetCacheGTSReportSweepFreq safely sets the value for global configuration 'Cache.GTS.ReportSweepFreq' field +func SetCacheGTSReportSweepFreq(v time.Duration) { global.SetCacheGTSReportSweepFreq(v) } + // GetCacheGTSStatusMaxSize safely fetches the Configuration value for state's 'Cache.GTS.StatusMaxSize' field func (st *ConfigState) GetCacheGTSStatusMaxSize() (v int) { st.mutex.Lock() |